For known size , the negative binomial distribution is an exponential family with natural parameter and cumulant . A generalized linear model can use a logarithmic link function for its mean, even though that link is not canonical. Jointly estimating the size changes the family and variance function, requiring additional updates beyond a single fixed-family GLM fit; this is what
MASS::glm.nb does.For a conditional count mean , suppose the distribution of is independent of the covariates and has finite . Integrating over gives the displayed logarithmic link function mean: every slope stays unchanged, and only the intercept shifts. This is an exact property of the log link; it does not hold in this form for the logit.
If and the distribution of is the same at each observation time with finite positive mean, integrating out adds to the marginal log-mean intercept. The conditional positive- mean ratio and the marginal mean ratio both equal . This is a property of the multiplicative logarithmic link function; it need not hold for nonlinear links such as the logit link.
Past exam of the mathematics course of the University of Cambridge 2002 iii Paper 36 4 ii Solution Created 2026-10-03 Updated 2026-10-14
For the marginal mean model, is the expected term count for a student with all recorded covariates at their reference or zero values. If the treatment indicator is one for the new therapy and zero for the reference treatment, then is the ratio of population mean counts under the two treatments, holding the remaining covariates fixed. Values below one mean a reduced expected count; is the corresponding percentage reduction.
For the random-intercept model, is the conditional reference count at , or multiplier ; the conditional baseline for student is . It is not automatically the mean-population baseline, which is . The conditional treatment rate ratio for students with the same multiplier is . Because the multiplier has the same distribution in the treatment groups and the mean uses a logarithmic link function, that is also the marginal treatment rate ratio. This is the property that marginal and conditional slopes agree for an independent log-link random intercept.
The parameter is the variance of the positive student multiplier, not a Poisson sampling variance or a treatment coefficient. Greater at fixed means greater heterogeneity in underlying propensity and larger between-term covariance. Its extra contribution to the count variance is . If is imposed, is also the relative multiplier variance; otherwise the relative heterogeneity is .
There is a necessary identifiability qualification: if the multiplier mean is also unrestricted, scale identifiability in a gamma random-intercept Poisson model shows that replacingleaves the response law unchanged. Consequently only and , together with the slopes, are identified from these counts without a scale convention. Fixing the multiplier mean, usually to one, is needed to interpret the conditional intercept and heterogeneity scale separately.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 6 b i Solution Created 2026-10-03 Updated 2026-10-06
There are two different effect scales in this zero-inflated Poisson regression. The count component describes the mean conditional on belonging to the susceptible component, including its possible zero outcomes. Its logarithmic link function coefficients exponentiate to ratios of those conditional means. The zero component describes the structural-zero probability ; its logit coefficients exponentiate to odds ratios, not probability ratios.
Holding the other covariates fixed, Centre B versus Centre A changes the susceptible count mean by the factoran increase of about . It simultaneously multiplies the odds of being a structural zero byThus Centre B is associated both with higher count intensity among susceptible patients and with greater odds of belonging to the never-at-risk class.
Use no personality disorder as the reference. For women, borderline disorder multiplies the susceptible count mean by , and other disorder multiplies it by . Because the count model has sex-by-disorder interaction terms, the corresponding male comparisons must add the interactions before exponentiating:These compare men with the stated disorder to otherwise comparable men without a disorder; the female comparisons use female reference patients. The interaction multipliers and alone are ratios of these sex-specific disorder ratios, not the overall male disorder effects.
In the zero component there is no sex-by-disorder interaction. Borderline and other disorders multiply the structural-zero odds relative to no disorder by and , respectively, holding centre fixed; these comparisons are the same for both sexes in the fitted zero model.
The marginal mean is . Therefore none of these count multipliers alone is the population-average change in expected episodes when the same covariate also changes . For a count coefficient change and zero-logit change from baseline zero predictor , the marginal mean ratio isFor centre use ; for disorder use its sex-specific count contrast and its zero contrast. This is the component and marginal effects in zero-inflated regression distinction needed to interpret these results carefully.
Past exam of the mathematics course of the University of Cambridge 2015 ii Paper 1 10J Solution Created 2026-09-24 Updated 2026-10-06
The Poisson regression uses independent counts with mean and logarithmic link function. Writing for concentration, the fitted predictors for strains are respectivelyThe interaction formula includes concentration, strain indicators and their products. The intercept is the baseline log mean at zero toxin; exponentiating it gives about fleas. Strain coefficients compare log means at zero concentration. Interaction coefficients compare concentration slopes with the common strain. A unit concentration increase multiplies the three means by about , and respectively.
For design matrix , the fitted expected Fisher information is , , since a Poisson count has variance equal to its mean. Standard errors are square roots of diagonal entries of . Each reported Wald test divides its coefficient estimate by its standard error and compares with an approximate standard normal distribution under a zero-coefficient null, conditional on the other terms. Concentration has strong evidence of a negative baseline effect. At zero concentration strain 1 is not significant at 5% (), while strain 2 is (). The strain-1 slope differs strongly from the baseline (); the strain-2 slope has no detected difference (). A nonsignificant difference is not proof of equality. The very significant intercept is a test of mean one at zero toxin, with little scientific relevance.
Relabelling factor levels merges strains 0 and 2 into one group and leaves strain 1 separate. Model retains three intercepts but allows only two slopes: strain 1 versus the common slope of strains 0 and 2. Thus it has five parameters, compared with six in . Model merges both intercepts and slopes for strains 0 and 2, retaining only four parameters. The natural nesting is .
For these nested generalized linear models, the difference in Poisson deviance is an asymptotic likelihood-ratio test statistic with degrees of freedom equal to the parameter difference. Comparing with gives on one degree of freedom, far below : the additional strain-2 slope is unnecessary. Comparing with gives on one degree of freedom, far above : merging the strain-0 and strain-2 intercepts is rejected. Comparing with uses on two degrees of freedom and requires a two-degree-of-freedom threshold, about , rather than the supplied .
is the most appropriate of the three models: retain different strain baselines and the special strain-1 slope, but pool the unsupported strain-2 slope difference. Residual degrees of freedom are ; deviances of this magnitude give no obvious evidence of overdispersion from these summaries alone.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 206 3 a Solution Created 2026-10-03 Updated 2026-10-06
The initial Poisson regression contains altitude, temperature, and their interaction term, with a logarithmic link function. Its interaction Wald test has , suggesting removal of that term while initially preserving both main effects. The resulting additive model has a negligible temperature effect (), suggesting a second simplification to altitude alone. The nested analysis of deviance for nested generalized linear models gives the same provisional decisions: deviance increases are and , each for one removed coefficient, with approximate upper-tail probabilities and . The Akaike information criterion also decreases at each step.
For independent island counts the final proposed model iswith fitted relationThis is an exponential mean relation on the count scale, not a linear relation between count and altitude. One additional metre multiplies the fitted expected count by . The null model's insignificance of individual main effects in the interaction fit does not require discarding every predictor: correlated design columns can make those conditional tests imprecise. These reductions concern relative mean complexity under the working Poisson regression; the large residual deviance in all three models warns that their variance or mean assumptions still need investigation.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 1 c Solution Created 2026-10-03 Updated 2026-10-05
The negative binomial regression assumes independent random variables conditional on their recorded days, withThe logarithmic link function applies to the conditional expectation, not to the observed count. The displayed maximum-likelihood estimates areand the dispersion parameter for the fitted family is one. Thus the fitted variance is , practically the Poisson distribution variance at these means.
Increasing the day by one multiplies the conditional expectation by , a decrease of about . Comparing days 365 and 1 gives . The negative slope has Wald statistic approximately , so under the stated model assumptions there is very strong evidence of a decreasing conditional mean:This is an association with calendar day, not a causal effect established by the regression. The printed negative-binomial residual deviance is on residual degrees of freedom, which is a reason to investigate the adequacy of the assumed count model and dependence structure. In particular, the small reported slope standard error cannot make a misspecified model reliable.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 206 3 d Solution Created 2026-10-03 Updated 2026-10-05
Because no family is specified, the command fits a Gaussian identity-link generalized additive model:The are centered penalized regression splines with cubic regression bases; centering separates them from the intercept. The age curve in the original figure falls to a minimum near age 25, then rises markedly, particularly from about 40 onwards. Its effective degrees of freedom are , reflecting curvature. The white-cell curve has effective degrees of freedom one and is nearly flat with a slight positive slope; the pointwise uncertainty bands are consistent with no substantial effect. These plots display centered partial mean contributions, not numbers of prescriptions by themselves.
A simpler mean model keeps the age regression spline and replaces the white-cell smooth by a linear term. A separate issue is that the response is a nonnegative count: a Poisson regression with logarithmic link function respects that support and positivity of the mean. A reasonable candidate isIf diagnostics show overdispersion, one can fitusing a negative binomial regression. Alternatively, if a Gaussian approximation is adequate, the minimal simplification is
model1p <- gam(npres ~ s(age, bs="cr") + wbc, family=poisson(link="log"))
gam.check(model1p)model1nb <- gam(npres ~ s(age, bs="cr") + wbc, family=nb(link="log"))gam(npres ~ s(age, bs="cr") + wbc). These are candidates to compare by diagnostics and validation, rather than guaranteed improvements from the partial plots alone. Retain the curved age effect; consider a linear or removable white-cell effect, and assess an appropriate count family. Refit before interpreting the old curves on a new link scale. Past exam of the mathematics course of the University of Cambridge 2017 ii Paper 4 5J a Solution Created 2026-09-24 Updated 2026-10-05
This is the appropriate command for the full contingency table. It fits a log-linear model to the nine cell counts, with logarithmic link function and no interaction:With baseline constraints on , there are five parameters. The factorized means express independence of treatment group and damage category. The maximum-likelihood estimates areAlthough the experiment fixes each row total at 30, conditioning these independent Poisson random variables on those totals produces the appropriate row-wise multinomial distribution. The Poisson trick therefore gives the correct likelihood inference for this independence log-linear model for a two-way contingency table; the margins are nuisance parameters. It tests whether treatment changes the distribution of damage, rather than modelling a binary outcome.
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 1 13J a Solution Created 2026-09-24 Updated 2026-09-29
Let be the number of ice creams in price category and score category . The fitted Poisson regression assumes that the nine counts are independent random variables withwhere the logarithmic link function is used and excellent is the reference level in a regression factor, so . Equivalently,This is the independence log-linear model for a two-way contingency table: price and score have main effects but no interaction.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 1 13J iv Solution Created 2026-09-24 Updated 2026-09-29
A suitable generalized linear model is a Gamma regression with logarithmic link:withThe gamma distribution is appropriate for a positive, continuous, right-skewed payment, and its variance function allows the conditional variance to grow like the square of the conditional mean instead of assuming constant variance. The logarithmic link function also guarantees positive fitted means and represents covariate effects multiplicatively, which accords with the Box–Cox transformation evidence for a logarithmic scale.
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 218 1 b Solution Created 2026-09-24 Updated 2026-09-25
The second fit is a Quasi-Poisson regression. It retains the logarithmic link function and mean modelbut assumes only for an unknown dispersion parameter , rather than a complete Poisson distribution.
Zero-inflated negative binomial model Created 2026-10-05 Updated 2026-10-07
With structural-zero probability , size and count mean , the model assigns to zero and to positive counts. Its expectation is and its variance is , by the law of total variance. A logarithmic link function can relate the count-component mean to predictors.