Unit 10 — Repeated measurements and crossover studies
Wednesday 11 November 2026, 12:30–16:00
Learn how repeated measurements and treatment switching affect design, analysis and interpretation. Use lme4 to fit the models, performance to check them and marginaleffects to estimate mean outcomes and comparisons directly.
No new video, reading or coding is required. Bring your Class 9 trajectory sketch and laptop if available. Essential teaching, complete scripts and supplied reference results are provided in class.
| Time | Work |
|---|---|
| 12:30–12:40 | Opening recall: treatment assignments and repeated observations |
| 12:40–13:15 | Calf example: one diet per animal, five weights, week-8 comparison |
| 13:15–13:40 | Crossover design: randomise AB/BA order, explain periods and washout |
| 13:40–13:55 | Break |
| 13:55–14:55 | Cow example: inspect, fit, check, predict and compare rations |
| 14:55–15:10 | Break |
| 15:10–15:35 | Save your group’s project analysis plan before fitting |
| 15:35–16:00 | Compare designs, report and individual exit |
In a crossover, each cow receives both rations in a randomly assigned order. We analyse actual synthetic cow-period records, allowing for period, assigned order and cows’ usual differences in appetite. We explain why a model cannot establish that earlier treatment effects have worn off.
Teaching slides Workshop slides 10-01 · Repeated and crossover activity
Open the instructor-supplied Posit Cloud project 10-repeated-measures. All data and scripts are in its project root. Both examples are synthetic. Approximate intervals rely on the specified model and scientific assumptions; repeated calf visits may share more than a calf’s tendency to stay heavier or lighter across visits.
Allow 60 minutes: revisit designs and slides (15), calf change comparison (20), then explain both studies, sketch two growth curves and update the project next action (25). The fuller calf change comparison moves here to make room for the in-class crossover analysis.
Consolidation slides 10-02 · Consolidation
Bring the worksheet and two possible growth curves to Class 11, which uses the unchanged calf dataset.