[R] drc results differ for different versions

Christian Ritz ritz at life.ku.dk
Fri May 22 11:29:47 CEST 2009

Hi Hans,

I hope I can resolve your problems below (Marc, thank you very much for cc'ing me on your
initial response!).

Have a look at the following R lines:

## Fitting the model using drm() (from the latest version)
m1<- drm(response ~ dose, data = d, fct = LL.4())

## Checking the fit by using nls()
## (we have very good guesses for the parameter estimates)
m2 <- nls(response ~ c + (d - c)/(1 + (dose/e)^b), data=d, start=list(b=-0.95, c=10,
d=106, e=1.2745e-06))

The standard errors agree quite well. The minor discrepancies between to two fits are
attributable to different numerical approximations of the variance-covariance matrix being
used in drm() and nls().

So I would use the latest version of 'drc', especially for datasets with really small
doses. One recent change to drm() was to incorporate several layers of scaling prior to
estimation (as well as subsequent back scaling after estimation):

1) scaling of parameters with the same scale as the x axis
2) scaling of parameters with the same scale as the y axis
3) scaling of parameters in optim()

The effect of scaling is to temporarily "convert" the dataset (and the model) to scales
that are more convenient for the estimation procedure. Any feedback on this would be much

Therefore it should also not be necessary to manually do any scaling prior to using drm()
(like what you did). Compare, for instance, your specification of drm() to mine above.

Is this explanation useful?!


More information about the R-help mailing list