Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 46 5 a Solution Created 2026-10-03 Updated 2026-10-14
The Cox proportional-hazards model specifieswhere is an unspecified common baseline hazard and is the individual's covariate vector. The hazard ratio for two fixed covariate vectors is , constant in time. Assume independent subjects and independent censoring conditional on their covariates, and use the question's absence of tied events.
Let be an event time, its failing subject, and the risk set immediately before that time. In a short interval of length , the conditional probability that subject fails, given one failure among those at risk, isThe baseline hazard cancels. Multiplying the successive conditional event-identity factors gives the Cox partial likelihood for :This is a partial likelihood, not the full survival likelihood for the unspecified . Risk sets evolve with the observed history; the derivation uses their successive conditional hazards, rather than assuming the risk sets themselves are independent.
Define and . For component ,Differentiating again givesThus the score and information of Cox partial likelihood are the sum of event-minus-risk-mean contrasts and the sum of risk-weighted covariance matrices, respectively. The Hessian is negative semidefinite; the likelihood is concave, with strict identifiability requiring variation in the relevant risk-set covariates.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 46 5 b Solution Created 2026-10-03 Updated 2026-10-14
At event time , the vector Schoenfeld residual iswhere is the fitted partial-likelihood coefficient. It compares the covariate of the person who actually failed with the covariate mean predicted for the failing person, using the fitted hazard weights over the risk set. Under the model at the true coefficient, the conditional expected failing covariate is precisely that weighted mean, so the corresponding Schoenfeld function is conditionally centered at zero. Residuals are defined at observed events, not at censoring times.
The score equation from part (a) is exactlyAt a finite interior unpenalized maximum, , soThis is the intended fitted-residual identity. For an arbitrary trial coefficient it is a score, not generally zero; a single event with covariates zero and one in its risk set can have Schoenfeld function at . Penalized estimates or a boundary maximum also need their own score conditions rather than this unqualified zero-sum assertion.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 46 5 c Solution Created 2026-10-03 Updated 2026-10-14
Under proportional hazards, each coefficient is constant over event time. Examine the Schoenfeld residuals, preferably scaled Schoenfeld residuals, against time or a prespecified transformation such as log time, ranks or a fitted survival-time transformation. Plot a smooth trend and its uncertainty for each covariate. Under the working model there should be no systematic residual-time association; a persistent trend suggests a time-varying coefficient. In a coefficient-scale plot that adds to the scaled residuals, the null trend is horizontal at the fitted coefficient.
A formal proportional hazards assumption test can add a time interaction, for example , and test using a score test with information adjusted for the fitted constant coefficients. The score contributions involve the Schoenfeld functions weighted by . One can test each covariate and use a joint global test for a vector of time-interaction coefficients. Such an association would be possible despite the unweighted residual sum being zero, so that fitted identity does not establish proportional hazards.
A systematic nonhorizontal coefficient trend or significant residual-time association is evidence against a constant hazard ratio. Failure to reject is compatible with the assumption, not proof of it. These diagnostics target the proportionality restriction; they do not by themselves verify covariate functional form or independence of the censoring mechanism.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 34 4 Solution Created 2026-10-03 Updated 2026-10-14
Write for the observed response and for column of the working design matrix . The usual LARS convention gives every covariate unit Euclidean norm. If an unpenalized intercept is fitted separately, first centre and the nonconstant covariates, and restore the intercept afterward. For an intercept-free model no centring is required. The algebra below also applies to an unscaled full-rank design; only the literal equal-angle interpretation uses unit-length columns. The penalty is defined on the regression coefficients of whichever working design is used, since rescaling covariates changes the units of an L1 penalty.
Initialize , and residual . At iteration , letThese are residual inner products, often called residual correlations. If , all normal equations are satisfied and the path has reached ordinary least squares. Otherwise the active set consists of the selected columns tied at the maximal absolute correlation. Initially select the maximizing column, or all such columns in a tie. Ordinary least angle regression retains previously selected columns and adds each new one when it ties the active correlations. Put for active .
To define the direction, form the signed active design and its Gram matrix . Full column rank makes this matrix positive-definite. Let denote the vector of ones of length , and setThen and . This is the equiangular direction in least angle regression. Define for every covariate, and define the regression coefficient direction by on , zero otherwise. It satisfies .
Along the line , residual correlations are . For an active index these equal , so all active absolute correlations decrease together until level zero at . An inactive covariate first joins when its correlation equals either sign of the common level. Solving these two equalities givesHere means the smallest finite strictly positive candidate; zero denominators do not produce a future entry, and an empty candidate set has minimum . Candidates beyond the zero-correlation endpoint are capped by that endpoint. TakeAt an entry add the newly tied covariate, or all simultaneous ties, and recompute the direction. Once all covariates are active there is no inactive candidate: the final move is to correlation level zero and the full least-squares fit. These definitions specify every term in the stated step formula and the entry knot in least angle regression.
For definiteness use the following penalty normalization for the Lasso estimator:Full column rank makes the criterion strictly convex, so the minimizer is unique. With the alternative squared-error normalization , the penalty parameter is divided by . The Karush-Kuhn-Tucker conditions for the Lasso in the chosen normalization areHence the zero vector is the solution for every . Along a sign-compatible least-angle segment the corresponding penalty is . Active correlation equalities and inactive bounds satisfy the KKT conditions exactly while each nonzero regression coefficient retains the sign . Ordinary LARS can let a regression coefficient cross zero while its correlation sign stays unchanged; continuing past that crossing would violate the KKT conditions.
The required modification is therefore to monitor regression coefficient zero crossings. Along , define the Lasso dropout knotwith ignored and the empty minimum again . Stop atIf a nonzero active regression coefficient reaches zero before the next entry, remove it from the active direction and recompute; the fitted value is continuous at this event. If entry comes first, add that covariate as before. A removed covariate is allowed to re-enter later, so the active set need not increase monotonically. The interior of a segment represents all penalty values through , rather than just the estimates at its knots.
For complete treatment of simultaneous events, full column rank alone does not imply that entries and dropouts occur singly. At a knot with positive level , let , be those correlation signs, and . The KKT-consistent resolution of tied Lasso knots chooses the next tangent byThis strictly convex quadratic program has a unique minimizer. For nonzero or newly entering coordinates its stationarity gives ; for tied zero coordinates kept out, . Thus for a small decrease of the penalty, has the correct regression coefficient signs, active residual scores , and inactive scores within . Strictly inactive coordinates remain feasible by continuity. Choose the resulting support for the next segment and normalize ; this reduces to the preceding equiangular formulas. It handles ties, including a newly tied zero regression coefficient whose unconstrained direction would point against its correlation sign, without perturbing the data.
At each successive event update the support in this manner and continue down to . Between knots the regression coefficients are linear in and satisfy the sufficient KKT conditions. For a fixed support and sign vector , the equalities give ; all sign and inactive-score constraints are linear inequalities in . Each support/sign pattern therefore has an interval of validity, and there are only finitely many such patterns, so the complete path has finitely many linear segments. Together with the initial zero solution for , these interpolated segments give
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 38 5 iii Solution Created 2026-10-03 Updated 2026-10-14
For patient , let be the fatigue state at time years since study entry. Let the covariate vector be , representing the sex indicator, arthritis duration in years, HAQ disability score and haemoglobin measurement. Conditional on these covariates, the continuous-time multi-state model has the Markov property and generator matrixEach allowed transition intensity has its own log-linear transition intensity model, . The zero entries exclude direct instantaneous jumps between mild and severe states, and the diagonals enforce zero row sums.
To express the estimates correctly, the printed intensities are evaluated at the sample covariate means , not at . Order the allowed transitions as . Their estimates arewith rows indexed by that transition order and columns by inEquivalently, the uncentred intercept is . The means are not printed, so the displayed rates cannot be treated as numerical zero-covariate intercepts.
The assumptions are independent patients conditional on their covariates; correctly observed fatigue states; no unmodelled history dependence once current state and covariates are known; positive adjacent-state intensities with the specified exponential covariate dependence and no interaction terms; and a noninformative observation and censoring mechanism for the conditional state-process likelihood. With fixed covariates the rates are homogeneous in time and holding times are exponential. Covariates updated at visits are treated as piecewise constant between observations, so each such interval has a constant generator, a piecewise-constant covariate approximation. In particular this is an approximation if a quantity such as duration changes continuously between visits.
For observations , conditioning on the initial observed state, the panel-observed multi-state likelihood is a product over patients and intervals ofwhere is the covariate value held over that interval. Multiple unobserved jumps within an interval are integrated out by this transition matrix. For example, a mild state followed by a severe state can have positive likelihood despite , because an unobserved moderate state can intervene. The panel observations within a patient are not independent; it is the Markov property that justifies multiplying conditional transition probabilities. The piecewise-constant handling of changing covariates is specified in the msm model documentation.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 38 5 iv Solution Created 2026-10-03 Updated 2026-10-14
For the mild-to-moderate transition intensity, an increment in a single covariate, with the others held fixed, gives the multiplicative ratio . Of the four printed effects on this transition, sex and HAQ have confidence intervals excluding zero on the log-intensity scale.
With male coded and female coded , the estimated hazard ratio for males relative to females isThus, conditional on currently being mildly fatigued and on the other covariates, males have an estimated mild-to-moderate transition intensity about lower than females. The conclusion concerns this particular instantaneous transition, rather than a general reduction in fatigue probability.
For a one-point increase in HAQ, indicating greater physical disability, the estimated intensity multiplier isGreater disability is therefore associated with a substantially faster mild-to-moderate transition, after adjustment for sex, arthritis duration and haemoglobin. Both conclusions use the specified log-linear transition intensity model and the nominal individual intervals. Arthritis duration and haemoglobin have intervals including zero for this transition, so their effects here are not statistically significant at ; this says neither that their effects are zero nor that they are insignificant for all other transitions.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 41 1 a Solution Created 2026-10-03 Updated 2026-10-14
Use separate randomization lists for women with and without a self-reported history of depression. Within each stratum, the central service could assign intervention and control in a ratio using randomly permuted blocks, preferably with concealed and varying block sizes. This is stratified randomization; the internet service can retain allocation concealment because the recruiting staff do not know the next assignment.
History is plausibly prognostic for the outcome. Keeping its distribution similar between arms reduces the risk of a chance imbalance in that important baseline factor and can improve precision. It also allows a comparison within each history stratum. Stratification does not guarantee balance of every other covariate, and staff must not be allowed to choose assignments. The regression model can retain history as a baseline covariate, respecting the design.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 41 1 e Solution Created 2026-10-03 Updated 2026-10-14
Let indicate a depressed outcome and indicate the control arm. A logistic regression could specifywith containing prespecified baseline characteristics, including the stratification factor. Fit the coefficients by maximizing the likelihood for independent Bernoulli random variables . For equal covariate values the control-to-intervention odds ratio is . Thus an estimate produces the quoted adjusted ratio. An ordinary Wald confidence interval is obtained by exponentiating the endpoints of the coefficient's confidence interval.
The raw control-to-intervention odds ratio, using the actual counts, isUsing only the quoted percentages gives about , so both versions are approximately . The printed is not the usual whole-percentage rounding of ; using the counts avoids that small numerical inconsistency. The reversed intervention-to-control ratio is about .
The apparent surprise is a coding issue: with depression as the adverse outcome and intervention relative to control, protection would give an odds ratio below one. A ratio above one is favourable if the comparison is control relative to intervention, as above, or if the outcome has been recoded as absence of depression and intervention is compared with control. Both comparison and outcome must be specified. The adjusted ratio need not equal the crude one, even in a randomized trial: covariate adjustment and noncollapsibility of the odds ratio can change an odds ratio. Their close numerical values here do not prove that the regression adjustment was unnecessary.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 41 2 a Solution Created 2026-10-03 Updated 2026-10-14
Interpret each mechanism for a fixed missingness pattern : the observed and missing response components are the coordinates selected by that pattern, and the covariates are assumed fully recorded.
For missing completely at random, missingness depends on neither response values nor covariates:For covariate-dependent missing completely at random, response observation may depend on but not on the response after conditioning on :This is conditional independence and can still produce a marginal association between response and missingness.
For covariate-dependent missing at random, the observation probability may use observed response components and covariates, but not the values missing under that pattern:For missing not at random, there remains dependence on after conditioning on ; the displayed simplification is not valid. For example, refusal could depend on the unreported response itself, even among individuals sharing all recorded covariates. These mechanisms concern the reason for nonobservation, not whether the incomplete records merely look irregular. Their distinction is not generally identifiable from the observed responses alone.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 41 2 b ii Solution Created 2026-10-03 Updated 2026-10-14
Assume that, conditional on the recorded embarrassment category, answering the item is independent of virginity status. Also assume that this category is assessed comparably for both groups and that both response strata have positive observation probabilities. This is covariate-dependent missing completely at random for the item response with embarrassment as the fully observed covariate; it supports MAR standardization over a fully observed covariate.
Use the responder probabilities and within strata, but the stratum sizes in the full group of responders plus item nonresponders: and . This givesEquivalently, the estimated missing positive counts are and , adding 22 to the 68 observed positives. The marginal estimate changes because the full group contains a larger proportion judged embarrassed. Merely copying the unstratified responder percentage would ignore that difference. The conditional independence assumption cannot be verified using the missing item responses.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 41 3 b Solution Created 2026-10-03 Updated 2026-10-14
Write the Cox proportional-hazards model as , where is the hazard multiplier and is the unspecified baseline hazard. At an untied event time , let be the risk set immediately before the event and its failing individual. With independent censoring conditional on the covariates, the conditional probability that individual supplies the next event, given an event at that time and the risk set, is obtained by dividing its instantaneous event rate by the aggregate rate:More precisely this is the limit of the conditional probability for one event in a short interval; simultaneous events have smaller-order probability in the continuous model. Multiplication of these successive conditional contributions gives the Cox partial likelihoodCensored individuals remain in each risk set until their censoring time but supply no numerator. Conditioning removes the baseline hazard; this is a partial likelihood for , rather than a complete likelihood for event and censoring times.
Ties require an observation model or an approximation. Suppose a recorded tie hides the order of continuous events, with no intervening entry or censoring. Put for the tied event set and . An exact marginal contribution for the coarsened ranks is the sum of the ordinary rank contributions over every possible order:For example, if fail together while remains at risk, the two possible orders giveThe risk set is depleted after the first of the two events. This expression concerns the missing event order; it is not the full likelihood of an interval in which the events occurred.
Convenient alternatives are the Breslow approximation for tied event times and the Efron approximation for tied event times:The first keeps the initial denominator at every event; the second removes an average share of the tied-event multipliers successively. In the example their denominators are and . These conventional partial-likelihood factors omit multiplicities independent of , which do not affect its estimate; they should not be mistaken for normalized probabilities of the unordered event set.
For genuinely discrete event times there is another exact construction. If individual event odds are proportional to , conditioning on exactly events gives the exact tied-set conditional likelihoodFor the same three individuals this is . It is not generally equal to the continuous-time rank sum: the assumptions differ.
Large tie groups make naive summation over orders or subsets impractical. Recursion helps with the subset denominator, and Breslow or Efron avoids exhaustive enumeration. However, extensive ties can also indicate that time is measured too coarsely for an exact continuous-time ordering to be a useful target.
For example, if patients are assessed only at annual visits, use one row per patient-year still at risk and model the probability of an event in that interval. A grouped proportional-hazards model follows directly by integrating the hazard over the interval, with covariates constant there:Fit the resulting person-period likelihood, with Bernoulli distributions for the interval event indicators and interval-specific intercepts. Many events in the same year are then ordinary observations rather than a combinatorial ordering problem. This requires a compatible interval-observation scheme and appropriate independent censoring; it avoids pretending that unobserved within-year event times are known.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 5 a iii Solution Created 2026-10-03 Updated 2026-10-07
True state dependence, also called true contagion, means that a previous outcome changes the distribution of a subsequent outcome after controlling both measured covariates and persistent unobserved heterogeneity. For example, an earlier successful week may make later success more likely through habit formation. A lagged-outcome coefficient in an inadequate statistical model can also reflect omitted subject differences, so positive observed persistence alone does not distinguish true state dependence from unobserved heterogeneity.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 5 a i Solution Created 2026-10-03 Updated 2026-10-07
Observed heterogeneity is variation in outcome propensities explained by measured covariates, such as age or sex. In logistic regression, subjects with different recorded predictor values may have different success probabilities, even before allowing for their previous outcomes. This is heterogeneity visible through observed predictors.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 5 b ii Solution Created 2026-10-03 Updated 2026-10-07
The second logistic regression adds while retaining the first lag and baseline covariates. The models are nested under . Their likelihood-ratio test statistic is the reduction in binomial deviance,Under the null and regular large-sample conditions for the correctly specified conditional likelihood, this has an approximate chi-squared distribution with one statistical degree of freedom. Since , reject at 5%; the approximate p-value is . Prefer the two-lag model to the one-lag model. Its additional lag captures statistically useful information in the history.
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 30 6 a Solution Created 2026-10-03 Updated 2026-10-07
Let be the transition intensity from state to , and let be the transition intensity matrix, with . For a continuous-time multi-state model with the time-homogeneous Markov property, the transition probability matrix is , with entry . Condition on each recorded initial state. Panel visits contribute transition probabilities; an exact entry into the absorbing death state contributes a statistical probability densityThis mixed panel and exact-death likelihood sums over the living state just before death. It accounts for survival until the event; replacing its final factor by would count deaths throughout the interval.
Using the actual visit times recovered from the PDF, the three individual likelihood contributions areHere means with , not a transition probability. Subjects 8 and 9 supply no event-density factor after their last panel observation. Assume independent subjects and noninformative examination and censoring times; conditional on their observation schedule, its distribution supplies no additional statistical parameter-dependent factor. The patients' covariates can be incorporated by using their own in these same expressions.
For the progressive structure used in the subsequent output, put , , and . The progressive illness-death model permits no recovery, soWhen , the continuous limit is . Thus the likelihood contributions simplify toIntermediate unobserved disease transitions remain integrated into each panel transition probability.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 30 6 b ii Solution Created 2026-10-03 Updated 2026-10-07
Let contain sex, the education indicator, and age at diagnosis. Write for the sample means. The output's baseline transition intensities are evaluated at those means, so use the centred log-linear transition intensity modelThe full transition intensity matrix isThe fitted centred baselines are , and fitted slope vectors in sex–education–age order areThe two sex coefficients displayed as zero are fixed by the specified constraints; they are not estimated to be exactly zero. There are three free baseline transition intensities and seven free covariate slopes. The sample means are not printed, so uncentred intercepts at cannot be recovered numerically from this output.
Conditional on fixed covariates, subjects follow independent, correctly classified continuous-time multi-state models obeying the time-homogeneous Markov property, with . The progression is irreversible and death absorbing, with constant transition intensities during follow-up for each subject. In particular, the model uses fixed age at diagnosis rather than attained age. It assumes noninformative observation and censoring, and treats death times as exact through the mixed panel and exact-death likelihood. The Markov property rules out an additional effect of elapsed time in the current state after conditioning on it and the recorded predictors.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 207 2 e Solution Created 2026-10-03 Updated 2026-10-06
Age changes during follow-up, so the generator matrix changes with time. The transition matrix must solve , with . It is generally not the matrix exponential of one constant matrix; even is not generally valid because the matrices at different times need not commute.
For example, write the age-dependent onset rate as and keep progression rate constant. ThenEven when the integrated onset rate is elementary, this remaining integral need not have an elementary closed form. Special cases can have closed forms; time dependence does not by itself prove universal impossibility.
For a tractable likelihood function, freeze age at its left-endpoint value, or a midpoint value, on each observation interval . The genetic covariate is already constant. This piecewise-constant covariate approximation gives a constant matrix on each interval and a product of closed-form interval probabilities:Here is the observed state at , and the likelihood function is conditional on the initial state. The approximation improves when intervals are short relative to the variation in the age effect.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 207 5 b Solution Created 2026-10-03 Updated 2026-10-06
Put and , so and . Its expectation is not generally one and depends on censoring. Under independent censoring, condition on : the exponential distribution givesWriting for the observed event indicator, it follows that . The exponential mean imputation under independent censoring therefore gives a modified Cox–Snell residual with known mean:On censoring, the added one is the expected remaining transformed lifetime, by memorylessness of the exponential distribution. This gives a mean-one variable, not necessarily another exponential variable. Equivalently, is a martingale residual with mean zero. Independent censoring, or its appropriate conditional version, is essential for these identities; arbitrary informative censoring does not justify the correction.
Fit a model using the relevant covariates, calculate , and plot these martingale residuals against a candidate explanatory variable or against an included variable's value. A smooth systematic trend away from zero can indicate an omitted effect or an unsuitable functional form, such as a nonlinear age effect. After fitting an appropriate effect, the residual trend should diminish. The equivalent plot of has mean-one reference rather than zero.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 207 6 b Created 2026-10-03 Updated 2026-10-06
This is administrative censoring. Under the usual assumption that entry calendar time is independent of the subsequent event time, it is an example of independent censoring, not informative censoring: the planned study closure, rather than a patient's prognosis, determines the available follow-up. Uniform entry by itself does not prove that assumption; if entry date is associated with prognosis, independence must instead be justified conditionally on the relevant covariates. The calculations below use independence.