Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 43 2 Solution Created 2026-10-03 Updated 2026-10-14
For an exponential dispersion family, differentiating the normalization integral with respect to gives an expected score of zero. The score is , hence . Differentiating again, the expected squared score is ; it is also . ThusThe canonical link function sets the linear predictor equal to the natural parameter: . The variance function is , so ; the dispersion parameter is separated from the mean-dependent factor.
The saturated statistical model has a separate mean for each response and fits , with boundary parameters interpreted by limits. At the same fixed dispersion, its log likelihood and the fitted model's log-likelihood define the scaled devianceThe unscaled deviance isKeeping dispersion fixed in this definition is essential; it is not a comparison with a separately estimated zero variance in a Gaussian saturated fit.
For the normal distribution, expanding its density exponent givesConsequentlyHere and the canonical link is the identity, so . The saturated natural parameter is . Substitution into the deviance formula yields
For the cholesterol fits, all formulae include an intercept. Model 1 has age and BMI with three coefficients; models 2 and 3 have one of these covariates with two coefficients; model 4 has only the intercept. Their residual statistical degrees of freedom are respectively . Their reported deviances are residual sums of squares, because these are Gaussian linear models.
The relevant hypothesis is in the full model, against , with age already present. Thus compare model 2 with model 1 using the partial F-test. Its extra sum of squares is , and the common variance is estimated from model 1 by . ThereforeSince , reject at ; the two-sided coefficient-test equivalent has . BMI is associated with cholesterol after adjustment for age, under the linear Gaussian model. The RSS values alone do not identify the sign of its coefficient or the size of the association.
For comparison, the marginal BMI test would compare model 4 with model 3, giving on statistical degrees of freedom, with . This does not answer the adjusted question and makes the BMI evidence appear stronger than the conditional test. Age also contributes after BMI: comparing model 3 with model 1 gives on statistical degrees of freedom, with . Thus retaining both predictors is supported at the stated level.
A raw deviance difference must not simply be compared with the supplied cutoff: Gaussian dispersion is unknown and the differences here are unscaled. If were known, the scaled difference would have a law. Estimating it from the full fit gives the exact finite-sample comparison above, with the appropriate denominator statistical degrees of freedom.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 43 3 i Solution Created 2026-10-03 Updated 2026-10-14
factor(day) treats the nine days as categorical rather than imposing a numerical time trend. rep(400,27) supplies the number of trials for every dish, and prop is the observed surviving proportion. The contrast setting uses treatment coding with day 1 as reference; the ordered-factor polynomial option is unused. Supplying these proportions to glm with the binomial family and weights gives precisely the grouped-binomial logistic regression likelihood for the counts. The weights represent trial counts, not additional independent dish observations. The binomial family's default link is the logit link and its dispersion is fixed at .Let be survivors in dish on day . Both fitted models assume independent . Model 1 specifiesso it has one common probability and one fitted coefficient. Its estimated probability is the total surviving count divided by the total trial count, .
Model 2 specifiesIt has nine coefficients and allows a separate probability for each day, while retaining a common probability for the three dishes within that day. The MLEs are the day totals divided by . In day order they areThe intercept is the first day's logit, and each other coefficient is its day's logit minus that reference. These are additive effects on log odds, not additive changes in survival probability.
The analysis of deviance adds the eight day indicators after an intercept-only model. Its residual deviance compares a fitted model with the saturated statistical model assigning one separate probability to each of the dishes. For fitted dish probabilities , the binomial deviance isThe binomial scale is one, so this is also scaled deviance. The reported decrease measures the extra fit provided by day. There are observational units for these residual statistical degrees of freedom, not separately fitted Bernoulli responses.