residuals.drc.Rd
'residuals' extracts different types of residuals from an object of class 'drc'.
# S3 method for drc residuals(object, typeRes = c("working", "standardised", "studentised"), trScale = TRUE, ...)
object | an object of class 'drc'. |
---|---|
typeRes | character string specifying the type of residual to be returned: raw/working residuals, residuals standardised using the estimated residual standard error, or studentised residuals based on the H matrix of partial derivatives of the model function. |
trScale | logical value indicating whether or not to return residuals on the transformed scale (in case a Box-Cox transformation was applied). |
... | additional arguments. |
The raw (also called working) residuals or some kind of scaled residuals extracted from 'object'.
Standardised residuals are the raw residuals divided by a scale estimate (if available).
Studentised residuals are obtained by dividing by a scale estimate and in addition a correction factor (square root of 1 minus h with h is a diagonal element in the hat matrix).
The 'standardised' residuals are available for least squares estimation with or without Box-Cox transformation or variance as a power of the mean.
## Fitting a four-parameter log-logistic model ryegrass.m1 <- drm(rootl ~conc, data = ryegrass, fct = LL.4()) ## Displaying the residual plot (raw residuals) plot(fitted(ryegrass.m1), residuals(ryegrass.m1))## Using the standardised residuals plot(fitted(ryegrass.m1), residuals(ryegrass.m1, typeRes = "standard"))## Overlayering the studentised residuals ... not much of a difference points(fitted(ryegrass.m1), residuals(ryegrass.m1, typeRes = "student"), col = 2)