= Solution
The <generalized additive mixed model> fits
$$
Y_{ij}=\alpha+f(t_{ij})+u_j+\varepsilon_{ij},\qquad
u_j\sim N(0,\tau_0^2),\quad\varepsilon_{ij}\sim N(0,\sigma^2),
$$
where $u_j$ denotes the furnace <random intercept> and $f$ is a centered penalized <cubic regression spline>. Its wiggly components have a mixed-model representation; there is no explicit furnace-specific <random slope> in this formula.
\b[The plotted smooth gives no evidence that a nonparametric <fixed effect> is needed.] It is essentially a straight rising line, and `s(stir,1)` indicates <effective degrees of freedom> close to one. The wider bands at extreme stirring rates reflect uncertainty, not detected nonlinearity. A linear fixed stirring effect is adequate on this evidence.
If the three supplied <Akaike information criterion> values are on a common valid likelihood basis, choose \b[`strength_model3`], the fixed linear slope plus random-intercept model: its AIC $206.6408$ is smallest, versus $208.3243$ for the additional <random slope> and $210.3425$ for the smooth. The differences are $1.6835$ and $3.7017$, respectively, so especially the random-slope comparison represents modest support rather than decisive evidence. Retaining the population slope is consistent with part (c); this choice removes only its random variation.
There is a likelihood-basis caveat in the literal printed commands. `lmer` fits by REML by default, whereas the Gaussian `gamm` call defaults to ML; direct AIC on these objects need not compare the same type of likelihood. Moreover the earlier ML ANOVA prints $210.22$ for `strength_model`, whereas this table prints $208.3243$, so these numbers should not silently be treated as one identical ML fit. To obtain a defensible common comparison, fit all candidates to the same observations by ML:
``
fit_slope <- update(strength_model, REML = FALSE)
fit_intercept <- update(strength_model3, REML = FALSE)
fit_smooth <- mgcv::gamm(strength ~ s(stir, bs = "cr"),
random = list(furnace = ~ 1), method = "ML")
AIC(fit_slope, fit_intercept, fit_smooth$lme)
``
The supplied ranking favours the simpler random-intercept model; the displayed original calls alone do not certify that ranking as a consistent ML comparison. This distinction is particularly relevant when the smooth changes the fixed-effect space. The Gaussian `gamm` ML default and mixed-model representation are documented at https://stat.ethz.ch/R-manual/R-devel/library/mgcv/html/gamm.html.
Back to article page