Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 32 6 Solution 2026-10-06
For an event at from subject , with covariate vector , define the Schoenfeld functionThe second term is the hazard-weighted mean covariate in the risk set just before the event. The Schoenfeld residual is this function evaluated at the fitted coefficient, . Calculate one residual vector per event, using every at-risk subject, including those who will subsequently be censored. There is no ordinary event residual assigned at a right censoring time.
The Cox partial likelihood score function is . At the true constant coefficient in a Cox proportional-hazards model, the conditional event subject is selected with weights proportional to , so each Schoenfeld function has conditional mean zero. If the coefficient varies with time, that centering changes. Plot residuals against event time or a transformation of it, smooth them, and investigate departures from zero. Scaled Schoenfeld residuals account for the risk-set covariate variance and can display departures in coefficient units; score function tests based on residual-time association provide a formal check. Risk-set composition affects unscaled residual variance, and the total residual score function can be zero by fitting even when a time trend is present.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 33 5 b iii Solution Created 2026-10-03 Updated 2026-10-06
The command
cox.zph checks the proportional hazards assumption test through time dependence of scaled Schoenfeld residuals. Under constant coefficients, their expected trend against transformed event time should be flat. A significant covariate-specific test would suggest that its coefficient varies with time; the global test checks the coefficients jointly.The p-values are for age, for gender and for group, with global . Thus these tests find no evidence against proportional hazards. They do not prove the assumption, establish the correct age functional form, or test the censoring mechanism.
The separate diagnostic plot targets the broader fitted survival distribution. The code evaluates a fitted cumulative hazard function at each observed time and multiplies by the subject's fitted hazard multiplier, forming Cox–Snell residuals:The curve returned without
newdata by survfit is a reference-profile curve, not necessarily the all-zero-covariate baseline. The multiplier must use the same centering as that reference curve; the fitted linear predictors use the model's reference convention. With this consistency, times the multiplier is the fitted subject-specific cumulative hazard.Part (a) shows why complete transformed event times should be approximately unit exponential if the Cox proportional-hazards model is correct. The Q–Q plot compares ordered fitted residuals with an independent random exponential sample. Most points are near the diagonal, with some upper-tail departures, so it gives no obvious indication of a gross distributional failure. A random reference sample adds simulation noise, and estimated parameters and tied recorded times prevent this from being an exact distribution-free test.
Importantly, four observed times are censored. Their transformed times retain the censoring indicators and are not complete exponential observations. Simply plotting all residuals as uncensored therefore gives only a rough visual check. A more appropriate Cox–Snell residual survival diagnostic fits a Kaplan–Meier estimator or Nelson–Aalen estimator to , retains the censoring flags, and checks whether the estimated cumulative hazard is close to , equivalently whether estimated survival is close to . Taken together, the supplied checks are broadly compatible with the fitted model, while none resolves potentially informative censoring from giving up.
Proportional hazards assumption test 2026-10-06
A proportional hazards assumption test assesses whether fitted covariate coefficients remain constant over time. A common implementation uses trends in scaled Schoenfeld residuals, with separate covariate tests and a joint global test. Failure to reject is compatible with proportional hazards, but does not establish the correct covariate functional form or independent censoring.