Data in Environmental Science and Eco(toxico-)logy

Quantitative Ecotoxicology, Page 101, Example 3.6, Langmuir

This is example 3.6 on page 101 of Quantitative Ecotoxicology - reproduced with R. This example is about adsorption and how to fit an adsorption model to data.

So we have a data.frame with two columns,
where N = amount adsorbed (mmol) per unit mass (g) and C = equilibrium concentration in the aqueous phase (mmol/ml).

We want fit a Langmuir Model (Equation 3.28 in the book) to this data.

The three methods described are:

Nonlinear Regression

linear transformation

linear transformation with weighting

Nonlinear Regression

This fits the model

to the data.

We supplied some starting values and specified the lower bonds for K and M as 0 (bonds can only be used with the port algorithm).

This gives us the estimates for K and M as:

$K = 2.097 \pm 0.188$

$M = 9.899 \pm 0.521$

The t and p-values of this output are not of interest for us (tests if the parameters deviate from 0).

We can plot the raw data and the model easily using the predict-function:

Linear model of transformation

We use were the reciprocal transformation, so C/N versus C.
First we create a the transformed y-variable:

Fitting a linear model to this data is done with lm():

Newman used N^4 / C^2 weighting. So first we need to calculate the weights:

And fit the linear model with weighting:

The R^2 is slightly higher: 0.977.

The result for K is:

and for M:

Are the models appropiate?

We can inspect the residuals of both models:

The linear model clearly shows an arc-pattern in the residuals - so the data may not follow a linear relationship.
The nonlinear model performs better.

Once again we reproduced the same results as in the book using R :)
Code and data are available on my github-repo under file name ‘p101’.