Linear mixed effects model for the Orthodont data:

\[\begin{aligned} y_{ij} &= c_{i0} + c_{i1} \, {\rm age}_{ij} \\ &= \beta_{0M} {\rm 1\!I}_{{\rm sex}_i = M} + \beta_{0F} {\rm 1\!I}_{{\rm sex}_i = F} + (\beta_{1M} {\rm 1\!I}_{{\rm sex}_i = M} + \beta_{1F} {\rm 1\!I}_{{\rm sex}_i = F}){\rm age}_{ij} + \eta_{i0} + \eta_{i1}{\rm age}_{ij} + e_{ij} \end{aligned}\]

where \(\eta_{i0} \sim {\cal N}(0 \ , \ \omega_0^2)\), \(\eta_{i1} \sim {\cal N}(0 \ , \ \omega_1^2)\), \({\rm corr}(\eta_{i0}, \eta_{i1}) = \rho\) and \(e_{ij} \sim {\cal N}(0 \ , \ \sigma^2)\)

For a given set of parameters, the application displays

  • the original Orthodont data,
  • the population prediction for boys \(\beta_{0M} + \beta_{1M}\,{\rm age}\),
  • the population prediction for girls \(\beta_{0F} + \beta_{1F}\,{\rm age}\),
  • prediction intervals for the predicted distance \(\hat{y}_{ij} = c_{i0} + c_{i1} \, {\rm age}_{ij}\),
  • prediction intervals for the measured distance \(y_{ij} = \hat{y}_{ij} + e_{ij}\).

The parameters of the model can be either modified using the sliders or estimated by ML or REML.

Estimated parameters are obtained with the “best'' model according to BIC. This model assumes that

  • there is an effect of sex on the slope but not on the intercept (\(\beta_{0M}=\beta_{0F}\))
  • there is a random effect on the intercept but not on the slope (\(\omega_1=0\))
library(lme4)
data("Orthodont", package="nlme")
lmer(distance ~ 1 + age:Sex + (1|Subject) , data=Orthodont, REML=FALSE)  # ML estimation 
lmer(distance ~ 1 + age:Sex + (1|Subject) , data=Orthodont, REML=TRUE)  # REML estimation