Learn R Programming

drc (version 1.2-0)

drm: Fitting dose-response models

Description

A general tools for fitting concentration/dose/time-response models.

Usage

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)

Arguments

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 5 elements specifying the non-linear function, the accompanying self starter function, the names of the parameter in the non-linear f unction and, optionally, the first and second derivatives.
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 '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
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
~~Describe method here~~
upperl
~~Describe method here~~

Value

  • An object of class 'drc'.

Details

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.

See Also

The function nls can also be used for nonlinear regression.

Examples

Run this code
m1 <- drm(ryegrass, fct = LL.4())
m2 <- drm(SLOPE~DOSE, CURVE, data=PestSci, fct = LL.4())
m3 <- drm(rgr~dose, pct, data=TM, fct = LL.4())

Run the code above in your browser using DataLab