Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 1 f Solution Created 2026-10-03 Updated 2026-10-07
A natural next fit is quadratic regression, which remains a normal linear model in its unknown regression coefficients:The new design matrix has rows and must have matrix rank three; three distinct predictor values suffice. The curved regression residual pattern suggests trying a positive quadratic term, but its sign and adequacy should be checked after fitting. Inspect the new regression residuals to see whether the systematic curvature has disappeared.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 2 d Solution Created 2026-10-03 Updated 2026-10-07
Test for both nonreference days, against at least one nonzero day fixed effect, conditional on chocolate. There are two added regression coefficients and residual statistical degrees of freedom. The nested-model F-test statistic isUnder and the normal linear model assumptions, . Its 5% upper critical value is , so do not reject the absence of day effects; the p-value is approximately . Thus the missing row has two statistical degrees of freedom, mean square , and the F-test value above. These observations do not provide evidence that including day improves the chocolate-adjusted mean model. They do not prove that every possible day effect or chocolate–day interaction term is absent.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 5 b i Solution Created 2026-10-03 Updated 2026-10-07
Let indicate a smoking-free week, the recorded sex indicator, age in years and assigned treatment. The screening history supplies ; earlier lag initializations are also zero. A history-dependent logistic regression for the first model isHere , is the observed past, and the five unknown regression coefficients have time-invariant values. Conditional on baseline covariates, this model has the first-order Markov property: only the immediately preceding outcome enters the current conditional probability. Distinct subjects have independent histories. There is no subject random effect or additional time trend in this fit.
Using the chain rule for probabilities, the individual conditional likelihood isThe lagged values in are the individual's actual preceding outcomes. This product is a sequential conditional likelihood, not an assertion of unconditional independence of the ten readings. The full conditional likelihood is ; no extra Bernoulli distribution factor is attached to the fixed screening history.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 6 a Solution Created 2026-10-03 Updated 2026-10-07
Use one row per consecutive at-risk episode, retaining a patient identifier for dependence and an episode number for event order. In calendar time, the intervals are ; status is one if the row ends in a headache and zero if it ends in censoring. Patient 001 contributes
The fifth episode is censored, not a fifth observed headache. All rows retain . This start-stop recurrent-event data layout corresponds to the counting-process intensity in survival analysiswhere indicates that the patient is currently observed and eligible for a headache. Fit the regression coefficient by Cox partial likelihood using the resulting risk sets, and estimate the baseline cumulative hazard nonparametrically, for example by the Breslow estimator. Patient rows are portions of one history, not new independent patients.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 33 4 b Solution 2026-10-06
The chosen Poisson regression has fitted meanFor zero building cover, its fitted expected number of floods over the 25-year observation window is . Increasing the covered proportion by multiplies the fitted expected count by . Thus a ten-percentage-point increase, , multiplies the expected count by about , an increase of . A one-percentage-point increase multiplies it by about . The full-unit multiplier compares proportions differing by one, not percentages differing by one.
These are associations in the conditional expectation with the recorded final-year building cover. The regression coefficient is not automatically a causal effect of changing development, especially since the count covers 25 years while cover was measured at the end.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 35 3 i Solution Created 2026-10-03 Updated 2026-10-06
In a normal linear model, attach a continuous spike-and-slab prior to each regression coefficient. With suitably scaled predictors, introduce indicators and setThe narrow component describes practically negligible effects; the wide component permits substantial ones. Fit the joint Bayesian posterior of coefficients, indicators and any unknown residual variance. Bayesian model averaging gives shrinkage toward zero for poorly supported effects, while quantifies wide-component support. A shared Beta distribution prior on can represent uncertainty about how many effects are substantial.
Select on scientifically meaningful effect size, for example a high for a prechosen threshold in meaningful predictor units. Membership in the wide component alone does not imply a large realized effect: its normal distribution still permits values near zero. Correlated predictors also require interpretation of the joint Bayesian posterior, rather than treating each coefficient as an isolated test.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 3 b Solution Created 2026-10-03 Updated 2026-10-06
Let be the number of maintenance jobs, average temperature and average precipitation. The fitted Poisson regression assumes independent conditional responses withThe logarithm is the Poisson canonical link, so fitted means are always positive. The estimated regression coefficients areAt fixed precipitation, one unit of temperature multiplies the fitted mean by , a decrease of about . The fitted precipitation multiplier is per unit, but its large p-value gives little evidence for that effect. These are conditional associations, not established causal effects.
The intercept-only model has residual degrees of freedom, and the full model has . Both imply months.
For an approximate deviance goodness-of-fit test of the full Poisson regression, compare residual deviance with . Its upper-tail p-value supplies no evidence of lack of fit. The ratio also gives no striking indication of overdispersion, though deviance per degree of freedom is only a rough dispersion check. Fitted count means around fifty make the usual chi-squared approximation plausible. Independence between months, the conditional variance-equals-mean assumption and the absence of residual structure still need diagnostics. Failure to reject is not proof that the model is correct.
The null deviance on degrees of freedom has , suggesting the constant-mean model is inadequate. In the sequential analysis of deviance for nested generalized linear models, adding temperature to that model reduces deviance by on one degree of freedom, giving . Adding precipitation after temperature reduces it by only , with . Therefore retain temperature; these data give no reason to retain precipitation after temperature. The temperature-only residual deviance is on degrees of freedom. This prediction-oriented reduced model should be refitted before reporting its coefficients: the printed temperature coefficient belongs to the full model. The Wald test results, and , broadly support the same conclusion, while the sequential deviance tests answer the stated nested-model questions.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 35 1 c Solution Created 2026-10-03 Updated 2026-10-06
A complete-case analysis changes the mix of people contributing to the logistic regression. Let mean that both required variables are observed, and write . Within , Bayes theorem givesIf completeness depends differently on the two responses, and that selection also varies with partner count or the other predictors, the extra term changes the fitted regression coefficients. For example, people with high counts and poor condom use can be under-represented, weakening or otherwise distorting the apparent association. Dropping people with missing also excludes some whose membership of the target group is unknown.
The fitted conditional association among complete responders need not equal the target-population association. No direction of selection bias follows without specifying the response mechanism. Selection on predictors alone need not bias a correctly specified conditional logistic regression; it is the outcome-related selection described here that removes that reassurance.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 35 1 d Solution Created 2026-10-03 Updated 2026-10-06
Multiple imputation by chained equations specifies one conditional distribution for each incomplete variable. In general, let be the incomplete variables, the fully observed predictors, and the parameters of a model . The notation means all variables except . The models should respect each variable's support and contain the terms needed by the planned analysis.
First choose suitable models and initialise only the missing entries with admissible provisional values. One sweep updates in turn. At update , fit its model to records whose is observed, using the latest filled-in predictors. DrawThe first draw represents parameter uncertainty through a Bayesian posterior; the second represents residual uncertainty through a posterior predictive distribution. Replace the missing entries with these draws, leaving every genuinely observed entry fixed. Repeat whole sweeps until the chain has settled, assessing traces, mixing and plausibility. Obtain completed datasets from independently initialised chains, or sufficiently separated draws after convergence. Both parameter and missing-value uncertainty must be propagated; repeated deterministic prediction is not multiple imputation.
Here use a logistic regression for conditional on , age and sex. For , use an appropriate discrete count model conditional on , age and sex, such as a suitably checked negative binomial regression, allowing enough flexibility for skewness and nonlinear effects. Include interactions or transformations needed by the analysis in the imputation models. If condom use is structurally undefined for a record, preserve that applicability rule rather than treating it as ordinary missing data.
Impute the eligible survey information before discarding records solely because the observed is absent. In each completed dataset select its own records and fit the requested logistic regression. This allows a record with missing to contribute to the target group in some imputations and not others. Models must respect any known eligibility restrictions; if eligibility was independently known, use that information.
For a scalar regression coefficient, let be its estimate and its estimated variance in completed dataset . Rubin's rules giveThe standard error is . Use the corresponding multiple-imputation confidence interval, rather than treating one completed dataset as fully observed. For vector coefficients replace the squared differences by outer products and by the covariance matrix. This combines within-imputation and between-imputation uncertainty.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 207 5 c Solution Created 2026-10-03 Updated 2026-10-05
The ordinary Nelson–Aalen estimator adds at event time . Under a fitted proportional hazards model, replace the number at risk by the sum of fitted hazard multipliers:This is the Breslow estimator of the integrated baseline hazard, using fitted regression coefficients obtained by maximizing the Cox partial likelihood. The denominator arises because the total event intensity is ; with every multiplier equal to one it reduces to the Nelson–Aalen estimator.
The estimator is right-continuous, so already includes the event at . Subtracting it leaves only the events at and , whose risk sets are and . HenceThere is no increment at the censoring time . If the lower endpoint had instead been , an additional would be present. The final singleton event can increase the baseline hazard estimate even though its partial likelihood contribution is one.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 1 13J iii Solution Created 2026-09-24 Updated 2026-09-29
Because
model2 uses a logarithmic transformation, the logarithm of the payment ratio is the difference of two predicted log payments. The cars have equal Brand and Bonus values and differ by one Kilometres level, so its fitted mean is the displayed mileage regression coefficient, .For two independent future payments, the prediction interval must include both the standard error of and two independent residual errors. The estimated variance of the predicted log ratio is thereforeUsing the residual degrees of freedom shown in the output, a 95% prediction interval for a ratio of log-normal responses isWith , this is approximately . The interval is wide because it predicts the ratio of two individual future payments; an interval for the ratio of their fitted mean responses would omit the term.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 1 13J i Solution Created 2026-09-24 Updated 2026-09-29
Kilometres is an ordinal categorical variable: its five levels have a meaningful order. Treating it as an ordinary factor would use four indicator variables and hence four unrelated regression coefficients. Converting the levels to numerical scores instead imposes a single linear trend across successive mileage bands. This is more parsimonious and gives greater precision when that trend is a reasonable approximation, although it also assumes that adjacent levels are equally spaced in their effect. Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 3 5J b Solution Created 2026-09-24 Updated 2026-10-03
For the normal linear model, the Gaussian likelihood givesMaximization over gives the ordinary least squares estimator , and maximization over the variance givesAt this value the quadratic term in is . There are regression coefficients and one variance parameter, so substitution into the Akaike information criterion yields
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 4 5J a i Solution Created 2026-09-24 Updated 2026-09-29
The individual t-tests only test each regression coefficient after adjusting for the other covariate. Here neither covariate is individually significant at conventional levels, but from the abbreviated coefficient table alone one cannot conclude that neither explains the response: strong multicollinearity can make both standard errors large even when the covariates are jointly useful.
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 2023 ii Paper 4 13J i Solution Created 2026-09-24 Updated 2026-10-03
Let be the first team's goal count in match , let be row of the design matrix, and let be the regression coefficient vector. The fitted Poisson regression assumes that the are independent random variables withThe likelihood function maximized by
glm is therefore Quadratic regression 2026-10-07
A polynomial regression of degree two is linear in its unknown regression coefficients despite being curved in the predictor. Its design matrix has columns ; three distinct predictor values give full column matrix rank.