drm {drc} | R Documentation |
A general tools for fitting concentration/dose/time-response models.
drm(formula, curve, pmodels, weights, data = NULL, subset, fct, adjust = c("none", "bc1", "bc2", "vp"), bc = NULL, bcAdd = 0, type = c("continuous", "binomial", "Poisson", "survival"), start, start2, na.action = na.fail, hetvar = NULL, robust = "mean", logDose = NULL, fctList = NULL, control = drmc(), lowerl = NULL, upperl = NULL)
formula |
a symbolic description of the model to be fit. Either of the form 'response ~ dose' or as a data frame with response value in first column and dose in second column. |
curve |
a numeric vector or factor containing the grouping of the data. |
pmodels |
a data frame with a many columns as there are parameters in the non-linear function. Or a list containing a formula for each parameter in the non-linear function. |
weights |
a numeric vector containing weights. |
data |
an optional data frame containing the variables in the model. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
fct |
a list with three or more elements specifying the non-linear
function, the accompanying self starter function, the names of the parameter in the non-linear function and,
optionally, the first and second derivatives as well as information used for calculation of ED values.
Currently available functions include, among others, the four- and five-parameter log-logistic models
LL.4 , LL.5 and the Weibull model W1.4 . Use
getMeanFunctions for a full list. |
adjust |
a character string specifying the type of adjustment for variance inhomogeneity. |
bc |
a numeric value specifying the lambda parameter to be used in the Box-Cox transformation. |
bcAdd |
a numeric value specifying the constant to be added on both sides prior to Box-Cox transformation. The default is 0. |
type |
a character string specifying the data type: continuous is the only option currently. |
start |
an optional numeric vector containing starting values for all mean parameters in the model. Overrules any self starter function. |
start2 |
an optional numeric vector containing starting values for all variance parameters in the model. |
na.action |
a function which indicates what should happen when the data contain 'NA's.
The default is link{na.fail} . To omit 'NA's use na.omit . |
hetvar |
a vector specifying the grouping for heterogeneous variances. |
robust |
a character string specifying the rho function for robust estimation. Default is non-robust least squares estimation ("mean"). Available robust methods are: median estimation ("median"), least median of squares ("lms"), least trimmed squares ("lts"), metric trimming ("trimmed"), metric winsorizing ("winsor") and Tukey's biweight ("tukey"). |
logDose |
a numeric value or NULL. If log doses value are provided the base of the logarithm should be specified (exp(1) for the natural logarithm and 10 for 10-logarithm). |
fctList |
a list of functions in case different functions need to be fit to different curves. |
control |
a list of arguments controlling constrained optimisation (zero as boundary), maximum number of iteration in the optimisation, relative tolerance in the optimisation, warnings issued during the optimisation. |
lowerl |
a numeric vector of lower limits for all parameters in the model (the default corresponds to minus infinity for all parameters). |
upperl |
a numeric vector of upper limits for all parameters in the model (the default corresponds to plus infinity for all parameters). |
This function is intended to supersede the function multdrc
.
This function uses the function 'optim' for the minimisation. The control arguments are specified using
the function drmc
.
If the argument adjust
is "bc1" it may be necessary to constrain the optimisation
(using mdControl
) in order to comply with the requirement of non-negative values for the
Box-Cox transformation. Alternatively a constant can be added in the Box-Cox transformation (using bcAdd
). The residuals available will be based on the transformed response values.
If adjust
is "vp" then robust
is set to "mean".
For robust estimation MAD (median abslolute deviance) is used to estimate the residual variance.
Setting lowerl
and/or upperl
automatically invokes constrained optimisation.
An object of class 'drc'.
The curve
argument is subsequently used for plotting dose-response curves. For large datasets
it need not represent the actual curves, but it could represent several curves having the parameters
(to avoid too many curves in the plot). The same applies for use with the function ED
and SI
.
The columns of a data frame argument to pmodels
are automatically converted into factors.
This does not happen if a list is specified. The data frame argument allows collapsing parameters for
some or all curves (using colFct
), whereas the list argument allows specification of
additive models for the parameters.
Christian Ritz and Jens C. Streibig
The function nls
can be used for fitting general nonlinear regression models.
m1 <- drm(ryegrass, fct = LL.4()) m2 <- drm(SLOPE~DOSE, CURVE, data = spinach, fct = LL.4())