Solution
ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2011/ii/paper-4/5j/solution
Past exam of the mathematics course of the University of Cambridge 2011 ii Paper 4 5J Solution by
Codex 0 Created 2026-09-24 Updated 2026-10-14
Model each person's infections over the fixed exposure period as an independent Poisson random variable with mean , conditional on the explanatory variables. The sum over people is then Poisson distributed with mean , because independent Poisson counts add. This is reasonable for repeatable events occurring at an approximately constant rate without substantial clustering; the count need not be at most , so a binomial model would not describe repeated infections.
The Poisson regression uses a log link and the known offset . The omitted factor levels are the reference categories under treatment contrasts: their effects are absorbed into the intercept. Including all levels together with an intercept would make the design matrix linearly dependent. For the proposed new group, the relevant predictor uses the intercept, the infrequent-swimmer coefficient and the age-20–24 coefficient; beach and female are reference levels. HenceTo add the age-by-sex interaction, one possible R command iswhere
glm(count ~ freq + loc + age * sex, family = poisson, offset = log(n), data = swimmers)swimmers denotes the data frame. The product expands to both main effects and their interaction. There are two additional interaction coefficients because age has three levels and sex has two.The nested-model comparison is a likelihood-ratio test. The reduction in Poisson deviance is , asymptotically under the null hypothesis that both interaction coefficients are zero. Its reported -value gives evidence for an age-by-sex interaction at the five-percent level, though not at the one-percent level.
Neither fitted Poisson model fits well in an absolute sense. Comparing residual deviances with and respectively gives small tail probabilities: the deviance-to-degree-of-freedom ratios are about and . Improvement relative to the simpler model does not establish goodness of fit. Omitted structure, dependence or overdispersion could account for the remaining lack of fit; if the Poisson variance assumption is false, the nominal interaction-test calibration also needs reconsideration. The age label in the introductory legend is inconsistent with the actual model levels; the prediction uses the unambiguous age-20–24 row.
New to topics? Read the docs here!