---
title: "07-03 · Review the model results and prepare for next week"
description: "Practise explaining predictions and interactions, then consider animals sharing a pen"
order: 703
lang: en
format:
  html:
    code-line-numbers: false
    theme: cosmo
    embed-resources: true
    code-overflow: wrap
    toc: true
    code-copy: true
execute:
  eval: false
---

## What to do after class

Allow **60–75 minutes** before the next class on **28 October**: about 25 minutes using the [after-class slides](07-03-glm-after-class.html), 25–35 minutes reading, and 10–15 minutes writing the short answers below.

The two planned videos have not yet been recorded. The slides explain the examples in their place. If you cannot access the textbook, use the [recap](recap.html), your script and the supplied results for the same practice.

Continue in your instructor-provided Week 7 **Posit Cloud** project. You do not need a new project or new data.

## Review coefficients and predictions — about 12 minutes

Work through the first part of the slides. Start with the daily-gain example, then compare it with your own group's outcome.

The example changes the reference diet from Control to High fibre. Read the intercept values and the predictions for the two diets in Room 1. Why can the intercept change while the predictions for a given diet remain the same? Use the fact that the two intercepts refer to different diets in your explanation.

Then follow the probability calculation. It starts with a Control probability of 0.30 and an illustrative diet coefficient of −0.50 in a logit model. The slides define odds, calculate the odds ratio, and convert the High fibre odds back into a probability. Explain why this is different from multiplying 0.30 by the odds ratio.

## Review the diet-and-housing comparison — about 13 minutes

Use the second part of the slides and `reference/factorial-predictions.csv`. These belong to the separate 48-pen study with two diets and two housing conditions, not your group's diet-only dataset.

Find the four expected gains in Room 1 from the interaction model. Subtract Control from High fibre in Standard housing, then do the same in Enriched housing. State how much the estimated diet difference changes between the housing conditions, in g/day.

Finally, read the example about recording separate outcomes for the six pigs in a pen. Identify conditions they share, such as feed, room and pen environment. Keep the distinction between the number of observations and the number of independently treated pens.

## Reading — 25–35 minutes

Use Justin C. Touchon, *Applied Statistics with R: A Practical Guide for the Life Sciences and Beyond*, **second edition (2025)**.

- Spend 20–25 minutes on a worked example in **Chapter 7, Generalized Linear Models**, that is close to your group's outcome. Find what is measured, which family and link are used, and how a fitted coefficient is explained. Compare the example with your own output; if it uses a different response family, note that difference.
- Spend 5–10 minutes on interactions and `predict()` in **Chapter 6, More Linear Models!** Connect the discussion to the four diet-and-housing predictions from class.

[Book contents](https://academic.oup.com/book/59888) · [Chapter 6](https://academic.oup.com/book/59888/chapter/511923382)

## Write and save these answers — 10–15 minutes

1. **Describe your group's model.** Write its formula and explain what the outcome column measures. State which unit received diet, why room is included, and which family and link you used.
2. **Explain the Room 1 predictions.** Give the expected outcome under each diet, with units and the intervals showing uncertainty. Say whether you are reporting a gain difference, expected-outcome ratio or odds ratio, and explain it in words. The recap provides a guide for each group.
3. **Explain the housing result.** Give the two High fibre minus Control gain differences from the separate housing study. State which housing condition has the larger estimated difference and by how much. Refer to the four predicted gains in your explanation.
4. **Draw how animals are grouped.** Draw two pens with six pigs in each and label each pen's assigned diet. Imagine recording a separate 0/1 treatment outcome for every pig. Give one reason why pigs sharing a pen might have similar outcomes, then explain why adding those animal observations does not add independently assigned pens.

Keep the script, answers and drawing for next week. Write down one point you would like the instructor to explain again; you are not expected to fit a mixed model before the class.
