Unit 8 — Split plots, Latin squares and unequal groups

Wednesday 28 October, 12:30–16:00

Follow treatment assignments into models, checks and useful comparisons.

Explain random effects and their formula notation, then fit models for shared pen conditions, split plots and Latin squares, then examine what changes when group sizes are unequal. Use the modelling packages directly and explain their output.

No new preparation. The student handout sets out the class activities.

Time Work
12:30–12:40 Opening recall: animals and pens
12:40–13:20 Random effects, more variable slopes and centred time
13:20–13:40 Split plots: whole-pen diet, section bedding
13:40–13:55 Break
13:55–14:25 Latin squares: blocking in two directions
14:25–14:55 Unequal counts and clearly weighted comparisons
14:55–15:10 Break
15:10–15:30 Gaussian random effects, QQ plot and a residual check
15:30–15:45 Project design and data audit
15:45–16:00 Compare designs and individual exit

Student activity

Foundations slides · Workshop slides

Open student-starter.R in the supplied Posit Cloud project 08-glmm-analysis. It uses lme4::lmer() for Gaussian mixed models, lm() for the spatial broiler Latin square, performance for checks and marginaleffects for comparisons. All data are invented teaching examples. The output and intervals are executed from the shown code.

Allow 75 minutes: review random effects, designs and numerical checks (15), fit a yes/no extension (15), plan a simpler future pen trial with simglm (30), and try larger pen counts to recommend a plan (15). The comparison with a model that ignores pens, detailed numerical checks and the reverse bedding comparison use the existing follow-up review time. This leaves room for centred time and the Gaussian random-effects explanation in class. The binary demonstration remains follow-up work.

After-class activity

After-class slides · After-class handout

Try adding pen counts above 32 in power-planning.R and recommend a plan with at least 0.8 power under the two assumed between-pen SDs.