prepareGen {MCPModGeneral} | R Documentation |
Prepare General Data for the MCPMod Function
Description
This function serves as an alternative for using the MCPModGen function
directly for general data. The function returns the estimates for and
, which are needed for MCPMod.
Usage
prepareGen(
family = c("negative binomial", "binomial", "poisson"),
link = c("log", "logit", "probit", "cauchit", "cloglog", "identity", "log risk ratio",
"risk ratio", "sqrt"),
w = NULL,
dose,
resp,
data = NULL,
addCovars = ~1,
placAdj = FALSE,
offset = NULL,
...
)
Arguments
family |
A character string containing the error distribution to be used in the model. |
link |
A character string for the model link function. |
w |
Either a numeric vector of the same length as dose and resp, or a character vector denoting the column name in the data. |
dose |
Either vectors of equal length specifying dose and response
values, or character vectors specifying the names of variables in the data
frame specified in |
resp |
Either vectors of equal length specifying dose and response
values, or character vectors specifying the names of variables in the data
frame specified in |
data |
Data frame with names specified in 'dose', 'resp', and optionally 'w'. If data is not specified, it is assumed that 'dose' and 'resp' are numerical vectors |
addCovars |
Formula specifying additive linear covariates (e.g. '~ factor(gender)'). |
placAdj |
Logical specifying whether the provided by 'resp' are to be treated as placebo-adjusted estimates. |
offset |
Either a numeric vector of the same length as dose and resp, or a character vector denoting the column name in the data. |
... |
Additional arguments to be passed to |
Value
A list containing the vector and
matrix.
Examples
# Analyze the binary migraine data from the DoseFinding package.
data(migraine)
models = Mods(linear = NULL, emax = 1, quadratic = c(-0.004), doses = migraine$dose)
# Now analyze using binomial weights
PFrate <- migraine$painfree/migraine$ntrt
migraine$pfrat = migraine$painfree / migraine$ntrt
muS = prepareGen("binomial", "logit", w = "ntrt", dose = "dose",
resp = "pfrat", data = migraine)
## Look at the elements of muS
muS
MCPMod(muS$data$dose, muS$data$resp, models = models, S = muS$S,
type = "general", selModel = "aveAIC",Delta = 0.2)