Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 5 c Solution Created 2026-10-03 Updated 2026-10-06
Both fits use the Gaussian generalized additive modelwhere is experience and education. Centering makes the additive decomposition identifiable. No experience-education interaction term is included.
The first fit uses local linear regression for each term.
span=1 includes all observations in each nearest-neighbour neighbourhood, but distance weights and a moving target still vary: it does not make the fit exactly a global straight line. The second uses cubic smoothing splines, with separate tuning values spar=0.8 and spar=1.2. Increasing spar increases the curvature penalty and smooths more; spar is a monotone tuning parametrization, not the numerical in part (b). The relation depends on the predictor scaling and design.The plotted experience effect is increasing in both fits. The local fit gives a broadly smooth, nearly linear rise; the spline fit follows more of the steep low-experience rise and subsequent flattening, especially near the lower boundary. Education has a weaker increasing effect. The local estimate shows some curvature, while the spline fit at
spar=1.2 is closer to a straight line. The clearest difference is the amount of smoothing and the experience curvature, rather than opposite effect directions. These are centered partial-effect plots with partial residuals, not scatterplots of wage against each predictor alone.A smaller local span would allow the first fit to capture more experience curvature. A moderately smaller education
spar could reveal nonlinear detail suppressed in the second fit; its small but significant nonparametric component in part (e) supports checking that possibility. Do not tune solely to follow every point, especially at sparse boundaries. Compare candidate spans or separate spline penalties using cross-validation or generalized cross-validation; increase smoothing if flexible fits introduce unsupported wiggles. See the documented monotone spar–penalty convention at stat.ethz.ch/R-manual/R-patched/library/stats/html/smooth.spline.html. Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 1 b Solution Created 2026-10-03 Updated 2026-10-05
Write for rats and for repeated observations. With diet 1 as the reference level in a regression factor, the random-intercept linear mixed model iswith the two families of normal distributions independent and the covariates treated as fixed. The reported estimates areThe corresponding estimated standard deviations are and grams. Individual realized random intercepts are not parameters in this marginal model, and their predictions are not supplied by this summary. For distinct measurements on the same rat, , while the marginal variance is ; different rats are independent.
The estimated mean weight rises by grams per day, adjusting for diet and the rat's random intercept. This common slope is imposed across all diets: there is no time-by-diet interaction term, so these estimates do not compare diet-specific growth slopes. The intercept refers to time zero for diet 1 and a zero rat effect.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 4 a Solution Created 2026-10-03 Updated 2026-10-05
Let denote Progabide and placebo; write for age and for baseline count. The fitted Poisson regression specifies independentIts log-likelihood isThe coefficient table in the original PDF, whose TeX transcription is truncated, gives the maximum-likelihood estimatesFor the treatment interaction contrast in a Poisson regression, the baseline slope of the log mean is on placebo and on Progabide. At fixed age and baseline , the fitted drug-to-placebo mean ratio is . Increasing baseline by one multiplies that ratio by . Thus the interaction term describes how the treatment ratio changes with baseline, rather than a uniform additive change in seizure counts. The displayed call makes clear that the source's
summary(model1) line is an object-name typo for the epilepsy fit. Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 4 c Solution Created 2026-10-03 Updated 2026-10-05
Under a correctly specified Poisson regression with adequate expected counts, the residual Poisson deviance is approximately chi-squared distribution with residual degrees of freedom. The observed givesThus the ordinary Poisson model gives a very poor fit under this goodness-of-fit approximation. This is consistent with overdispersion, although a wrong mean model or dependence can also cause lack of fit; quasi-Poisson variance inflation alone does not establish that the mean model is adequate.
For Quasi-Poisson regression, . The Pearson dispersion estimator isIt uses squared Pearson residuals, not the residual deviance divided by 102. The fitted coefficients are unchanged, and their estimated covariance matrix is multiplied by . With , standard errors increase by , so the main treatment coefficient hasThe main Progabide coefficient is not significant at 5% after this dispersion adjustment. R uses a Student's t-distribution when dispersion is estimated, as described in its GLM summary documentation; the large-sample normal approximation also gives the same decision.
Because an interaction term is present, this tests the treatment contrast at baseline zero. An overall absence of treatment influence requires the joint null . The printed marginal standard errors do not give their covariance, so they are insufficient to calculate that joint Wald test, or the treatment contrast test at an arbitrary nonzero baseline.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 218 1 c Solution 2026-10-03
Add a sex-by-treatment interaction term:In R the formula becomes
prop ~ sex * treatment. There are four parameters for four cell probabilities, so this model is saturated and, provided the cell proportions lie strictly between zero and one, fits each observed proportion exactly. It therefore recovers all the stated order relations. Past exam of the mathematics course of the University of Cambridge 2021 ii Paper 1 13J a iii Solution Created 2026-09-24 Updated 2026-09-25
The additive model has four free coefficients: an intercept, two treatment contrasts, and one outcome contrast. The interaction model addstreatment-by-outcome interaction term, making six parameters for six cells. It is saturated, so the residual degrees of freedom fall from two to zero and the likelihood-ratio test has
The deviance reduction is , with p-value . The analysis of deviance for nested generalized linear models therefore gives overwhelming evidence against a common outcome distribution across the three groups. The observed proportions and the negative treatment--Worse interactions show that both doses reduce the chance of worsening relative to Control, with a larger reduction for LD.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 4 5J Solution Created 2026-09-23 Updated 2026-09-25
Writing , , and , the fitted normal linear model isThe R formula
lstat * age includes both main effects and their interaction term.Three notable features are:
- The fitted model is highly significant overall: its statistic is on degrees of freedom with . Its , however, means that about of the observed response variation remains unexplained, and the residual standard deviation is about house-value units.
- At fixed age, the fitted slope with respect to lstat isThe large negative main coefficient is strongly significant. The positive interaction is significant at the level (), indicating that this negative association becomes slightly weaker for older housing tracts.
- The age main-effect estimate is essentially zero with , but it is the age effect specifically at and should not be interpreted separately from the significant interaction. The diagnostic plots also show curved residual structure, increasing spread, a heavy upper tail with observations 215, 372, and 373, and substantial influence from observation 215. These features cast doubt on linearity, constant variance, and Gaussian residual assumptions.
Principle of marginality 2026-10-07
A hierarchical statistical model that contains an interaction term retains its associated lower-order effects. For two categorical predictors this means keeping both main effects when keeping their interaction. A nonsignificant averaged main effect may coexist with large opposite effects in different groups. Dropping its lower-order term while retaining the interaction can make the model depend on arbitrary factor coding.
Two-factor normal linear model 2026-10-06
A two-factor normal linear model describes independent responses with factor-specific means and common normal error variance. The additive mean assumes no interaction term; the full mean permits the first factor effect to vary with the second. Constraints or treatment coding identify the parameters. In a balanced two-by-five design the full model has ten free cell means.