Get the data from here and read it into R:
As always we first take a look at the data:
A simple power model may fit the data:
We could fit such model as in example 3.3 via Nonlinear Least Squares or we could try to linearize the relationship by a ln-transform of both DAY and LEAD:
Now we can us lm() to estimate the coefficients and check our model:
The residuals show no pattern:
From the model-output:
We see that out fitted model hast the formula:
with an R-squared of 0.77 and is statistically significant. The standard errors for the two parameters are 0.064 and 0.031.
So our backtransformed model would be:
Finally we can also plot our model:
Code and data are available at my github-repo under filename ‘p94’.