Learn R Programming

drc (version 1.2-0)

mdControl: Sets control arguments

Description

Set control arguments in the control argument in the function 'multdrc'.

Usage

mdControl(bcAdd=0, constr = FALSE, errorm = TRUE, maxDose = 1e-1, maxIt = 500, method="BFGS", 
          noMessage = FALSE, relTol = 1e-07, rmNA=FALSE, warnVal = -1, zeroTol=0)

Arguments

bcAdd
numeric. The constant to be added in Box-Cox transformation.
constr
logical. If TRUE optimisation is constrained, only yielding non-negative parameters.
errorm
logical specifying whether failed convergence in multdrc should result in an error or only a warning.
maxDose
numeric. The maximum dose allowed if scaling of dose is to be used.
maxIt
numeric. The maximum number of iterations in the optimisation procedure.
method
character string. The method used in the optimisation procedure. See optim for available methods.
noMessage
logical, specifying whether or not messages should be displayed.
relTol
numeric. The relative tolerance in the optimisation procedure.
rmNA
logical. Should NAs be removed from sum of squares used for estimation? Default is FALSE (not removed).
warnVal
numeric. If equal to 0 then the warnings are stored and displayed at the end. See under 'warn' in options. The default results in suppression of warnings.
zeroTol
numeric. The threshold below which doses are considered as control.

Value

  • A list with 8 components, one for each of the above arguments.

See Also

See the documentation on the data set PestSci.

Examples

Run this code
### Displaying the default settings
mdControl()  

### Using 'method' argument
model1 <- multdrc(ryegrass)

model2 <- multdrc(ryegrass, varPower = TRUE, startVal = coef(model1),
control = mdControl(method = "Nelder-Mead"))

rm(model1, model2)


### Using 'relTol' argument to improve accuracy

## Fitting a model to the PestSci dataset
model1 <- multdrc(SLOPE~DOSE, CURVE, data=PestSci)

## Fitting the same model in a different parametrisation
model2 <- multdrc(SLOPE~DOSE, CURVE, data=PestSci,
collapse = list(~factor(CURVE),~factor(CURVE),~factor(CURVE),~factor(CURVE)))

## Reducing the relative tolerance
model3 <- multdrc(SLOPE~DOSE, CURVE, data=PestSci,
collapse = list(~factor(CURVE),~factor(CURVE),~factor(CURVE),~factor(CURVE)),
control = mdControl(relTol = 1e-12))

## Comparing the parameter estimates
coef(model1)
coef(model2)
coef(model3)  # model3 is closer to model1 than model2 is 

rm(model1, model2, model3)

Run the code above in your browser using DataLab