Skip to main content Skip to navigation

Model of lamb weight from a 12 month longitudinal study

A multivariable generalised additive mixed model (GAMM) was fitted using the R package mgcv1. GAMs are an extension of generalised linear models where complex non-linear relationships exist and are expressed as a reduced rank smoothing spline2. The final multivariable model was constructed using a forward stepwise approach considering the alaike information criterion (AIC) and the statistical significance of variables. The model selection was carried out as follows:
1) introduction of random effects for lamb, ewe and lamb age;
2) fit of a smoothing terms for continuous variables lamb age, ewe age and birthweight, selection using lowest AIC;
3) addition of fixed effects as univariable models, including ewe age, birth weight, lamb gender, number of lambs suckled, management group, lagged BCS, lagged IMM and acute mastitis (AM) at different times in the study;
4) stepwise addition of variables with a p value <0.1 in the univariable models using AIC and variable significance to produce a final model;

The model took the form:

\[y_{ijk}=\beta_{0}+\beta_{} x_{ijk} + f(days_{ikj}) + u.age_{jk}+v_{k}+u_{jk}+e_{ijk} \]

where \(y_{ijk}\) was the continuous outcome variable of lamb weight (kg), \(\beta_{0}\) was the intercept, and \(\beta_{} x_{ij}\) was a series of fixed effects varying at \(ijk\) (obervation), \(jk\) (lamb) and \(k\) (ewe), \(f(age_{ijk}\) was the smoothing function on lamb age, \(u.age_{jk}\) represented a random slope for each lamb, allowing between-lamb variation for the effect of age on lamb weight. Residual variance estimates were included at ewe (\(v_{k}\)), lamb (\(u_{jk}\)), and observation (\(e_{ijk}\)).

GAMM multivariable model results


  1. S. N. Wood. Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models. Journal of the Royal Statistical Society (B), 73(1):3–36, 2011.

  2. Trevor Hastie and Robert Tibshirani. Generalized additive models. Statist. Sci., 1(3): 297–310, 08 1986. doi: 10.1214/ss/1177013604. URL 1177013604.

Kate Bamford

k dot e dot bamford at warwick dot ac dot uk

School of Life Sciences
University of Warwick

My Project Page

AHDB logo

MIBTP logo