We can identify two compartments on this plot: A slow one after day 22 and a fast one before day 22.

First we estimate and for the slow compartment, using linear regression of ln-transformed activity against day and predict from this slow compartment the activity over the whole period:

So this gives us the model for the slow component.

We do a bias correction and predict the activity for the whole data-range:

The residuals from these predictions for day 3 to 22 are associated with the fast compartment.
And we fit a linear regression to the ln-transformed residuals for the fast compartment.

So the model for the fast component is:

Now we have two models: one for the fast component and one for the slow component, and we can make a plot similar to Figure 8.1 in Newman and Clements (2008, pp. 119–120).

We can use this estimates as start-values to fit a non-linear Model to the data (therefore we stored them into objects).

We want to fit the following model:

is estimated as

is estimated as

is estimated as

is estimated as

And finally we plot data and model.

Again we get nearly the same results with R, except for some differences in the linear models.

This is probably due to the bias-correction in slow-component-model.
We have a MSE of

which is identical to the book. From the previous example, the bias can be estimated as
:

which is different to the book (1.002). However we only use this as starting values for nls() and the results of the non-linear regression are the same in R and SAS.

I have no SAS at hand, so I cannot check this with SAS. However let me know if there is an error
in my calculations.

Refs

Newman, Michael C., and William Henry Clements. Ecotoxicology: A Comprehensive Treatment. Boca Raton: Taylor /& Francis, 2008.

Code and data are available at my github-repo under file name ‘p89’.