Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 41 4 c Solution Created 2026-10-03 Updated 2026-10-07
A nonzero contribution occurs when a failure, rather than a censoring, is the earlier observation while both members remain at risk. By the paired log-rank reduction to a sign test, the two possible contributions are for an earlier A failure and for an earlier B failure. Under the exchangeable null and the usual independent censoring assumptions they are equally likely, conditional on being informative. HenceOnce the first member leaves the risk set, the second member's later observation adds no group-comparison information within this stratum.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 41 4 Solution 2026-10-07
At each event time within a stratum, let be the group risk sets and let be the total number of observed failures. Under the null of equal hazard functions, the expected A count is . The log-rank statistic adds observed minus expected A counts over event times; the stratified log-rank statistic first makes these comparisons within each patient stratum, then adds across patients. Let be the sum of the corresponding null conditional variances. The standardized statistic has an approximate standard normal distribution under the null, and its square has an approximate one-degree-of-freedom chi-squared distribution. Compare it with the appropriate quantile for a two-sided test, under the usual independent censoring and exchangeability assumptions.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 5 ii Solution Created 2026-10-03 Updated 2026-10-07
Keeping the event-free A individual under observation through day 193 leaves them in the risk set at both later B events. Now the calculations are
ThereforeThe negative score now indicates lower A event hazard, relative to B, in the contribution after day 160. The observed event counts have not changed. The change is in what events A was expected to contribute: its additional event-free exposure makes the two later B events informative comparisons, producing negative A score terms. No conclusion about the complete study's significance follows from this late contribution without the earlier scores and variances.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 5 i Solution Created 2026-10-03 Updated 2026-10-07
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 5 Solution 2026-10-07
The log-rank test compares survival experience through the allocation of events within the successive risk sets. Its null is equal hazard functions between the groups over follow-up, with independent individuals and noninformative censoring within groups. At each distinct event time , let be the numbers at risk immediately before that time, and let be event counts. Under the null, conditional on the total , the expected number of A events is .
The signed log-rank statistic is the observed-minus-expected scoreA positive score indicates relatively more A events than expected, hence a higher event hazard for A; B's score is its negative. Censoring times do not produce score terms, but remove people from all later risk sets.
At each event time the conditional null allocation is hypergeometric, as if the events were sampled without replacement from the risk set. Its variance gives the score-increment variance, with the finite-population correction for ties. Summing these conditional variances gives , since distinct-time martingale score increments have zero cross covariance under the null. For sufficiently many informative events, is approximately standard normal and approximately chi-squared with one degree of freedom. In the no-tie case, each variance contribution is . A time at which only one group remains at risk contributes no comparative information.
The numerical parts below report signed-score and variance contributions after day 160. They cannot be added as separate chi-squared statistics to the earlier follow-up: add the scores and variances first, and standardize once for the complete dataset. The log-rank test is particularly effective for proportional hazards alternatives; crossing hazards can produce cancelling score contributions.
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 2013 iii Paper 32 6 b Solution Created 2026-10-03 Updated 2026-10-07
The second episode starts only after the first headache, at 24.8; its row is absent from every risk set before that time. More generally, episode starts at the observed end of episode . The left-open, right-closed interval convention assigns an event at a shared boundary only to the interval ending there. Thus the first event is counted once, and the second cannot be counted before the first. Preserving the episode entry times and patient history enforces the ordering; entering every recurrence as a new record starting at treatment time zero would not do so.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 6 d Solution Created 2026-10-03 Updated 2026-10-07
For second and subsequent episodes, subtract the preceding headache time from both calendar endpoints. The new clock is the age since the start of that headache, not the age since recovery ended. Keeping the recovery restriction from part (c) therefore gives
For example, the second stop is , while its entry is . Thus subsequent rows begin at gap age three, not zero. The first row retains time since treatment started. Keep the patient and episode labels, and preferably the original calendar endpoints as auxiliary fields: gap ages in different episodes are not chronological treatment times. The value 7.1 for episode three being smaller than 8.3 for episode two does not reverse their occurrence order. This gap-time recurrent-event model forms risk sets on the episode-age scale while preserving each episode's historical eligibility.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 6 e Solution Created 2026-10-03 Updated 2026-10-07
Add a stratum indicator that is “First” for the first episode and “Later” for every subsequent episode, including the final censored episode:
A Stratified Cox model then uses distinct baseline hazards and , with a common treatment coefficient unless an interaction is explicitly desired. Form separate risk sets within the two strata and multiply their partial likelihoods. There is no need to force every later event number to have its own baseline when the stated aim is only first versus subsequent headaches. This is a first-event versus recurrent-event baseline stratification.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 32 7 Solution 2026-10-07
Begin by defining the scientific target: prediction for a new patient, or estimation of adjusted covariate effects. Check event definitions, follow-up origins, right-censoring codes and any delayed entry. The analysis assumes independent patients and censoring that is noninformative conditional on modeled covariates. For fixed explanatory variables , the Cox proportional-hazards model iswith an unrestricted baseline hazard and coefficients constant over time. Report as the conditional hazard ratio for a one-unit change in the coded variable, not as a risk ratio or automatically a causal effect.
For untied event times, fit the coefficients by maximizing the Cox partial likelihoodThe baseline cancels within each event risk set. Use an appropriate tied-event method, such as an Efron approximation or an exact method for a genuinely discrete event scale; the Breslow approximation for tied event times is another explicit approximation. Numerical score/information methods fit the model, and inverse information gives conventional covariance estimates for independent subjects. Report coefficient estimates, hazard ratios, uncertainty and the coding that makes their interpretation meaningful. After fitting, the Breslow estimator gives , from which provides predicted survival.
Adequacy is broader than significance of coefficients. Inspect influential observations, deviance residuals and data errors. Cox–Snell residuals should have approximately unit-exponential survival under a well-fitting model, retaining the original censoring indicators; a cumulative-hazard plot of these residuals should be near the 45-degree line. This is an overall diagnostic, not a substitute for the functional-form and proportionality checks below. For prediction, assess held-out discrimination and survival prediction calibration at prespecified time horizons with methods accounting for censoring. A high concordance index alone does not establish good calibration or correct hazard structure.
Use bootstrap or held-out cross-validation that repeats the complete modeling procedure, including imputation, variable selection and tuning. Validation of only the final fitted coefficients understates overfitting from earlier decisions. Report any substantive lack of fit rather than presenting a single time-independent hazard ratio when the data do not support that representation.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 32 4 Solution Created 2026-10-03 Updated 2026-10-06
For a counting process adapted to its observed history , a predictable counting-process intensity specifiesor more generally is a local martingale. In survival analysis, let record failures and record the risk set, including subjects at their own observation time. Under independent right censoring and a common hazard function , the aggregate intensity is , where and .
Writing , the conditional increment equation is . Replacing by the observed increment gives the Nelson–Aalen estimatorwhere ranges over the distinct observed event times. Censored observations remove subjects from subsequent risk sets but do not produce hazard jumps.
For these data the Nelson–Aalen estimator givesThus the six fitted cumulative hazards sum to , the number of observed failures.
The event-count identity for Nelson–Aalen cumulative hazards follows by exchanging the finite sums. With everyone entering at time zero,This includes each failure subject in its own risk set. A delayed-entry dataset requires a different risk indicator and is not covered by this particular identity.
Under a constant hazard survival model, . Imposing the same identity gives the events divided by exposure estimatorIts fitted cumulative hazards at the six times are , again summing to four. It is also the maximum-likelihood estimate under independent right censoring, since the parameter-dependent likelihood is . This is a sensible estimate if the exponential survival model is appropriate, but four failures give little precision. The event-count identity by itself does not validate constant hazard; the large final jump in the Nelson–Aalen estimator also reflects a risk set of one, rather than by itself proving an increasing hazard.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 32 5 Solution Created 2026-10-03 Updated 2026-10-06
For a proper continuous event time, the survival function is . The assumed invertibility of the cumulative hazard function gives, for ,ThereforeThis is the cumulative hazard probability transformation; it applies also conditionally on a subject's covariates, using that subject's correctly specified cumulative hazard function.
The fitted transformed times are Cox–Snell residuals. They retain their event/right censoring indicators, so a right-censored residual represents an exponential observation known only to exceed its displayed value. Under the fitted model and independent right censoring, calculate the Kaplan–Meier estimator of residual survival and compare it with , or calculate the residual Nelson–Aalen estimator and compare its cumulative hazard with the diagonal . Systematic departures reveal model inadequacy; sparse extreme residual risk sets and parameter estimation require caution. Treating all censored residuals as observed event times would invalidate this diagnostic.
Without right censoring, the residual mean should be approximately one. With right censoring, use the modified Cox–Snell residualFor a true unit-rate exponential distribution, the memoryless property gives . Thus an event keeps its known transformed time, while a censored observation is replaced by the conditional expected event time. Under independent right censoring, iterated expectation makes the mean of these adjusted values one when the true hazards are used, and approximately one when fitted hazards are used. These mean-imputed values do not themselves have an exponential distribution, so the survival-curve diagnostic should still use the original censored residual dataset. Moreover fitting equations can force the adjusted sample mean to one, making its mean alone a weak diagnostic.
For the proposed mixture of a finite right censoring time and no right censoring, andConsequentlyWhen right censoring has positive probability this choice is unique; if , no correction is needed and any has the same effect. Its independence from is the content of exponential memorylessness: the expected extra lifetime after any right censoring time is one. Conditioning on an arbitrary independent right censoring time proves the same correction beyond this special two-point mixture.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 32 6 a Solution Created 2026-10-03 Updated 2026-10-06
Conditional on an event and the immediately preceding history, probabilities are proportional to the three instantaneous hazards. Put . The two zero-covariate subjects each have weight one, and the one-covariate subject has weight . The common baseline hazard cancels. ThusEach individual with zero covariate has probability ; the first boxed probability is their combined probability. Conditioning on an event at a specified continuous time can be understood by the limiting conditional event probabilities in a short interval.
The hazard-weighted covariate mean is , so the Schoenfeld function at the true coefficient isMultiplying by the two conditional probabilities givesThis verifies the score-centering property directly for this risk set.
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 2014 iii Paper 32 7 b Solution 2026-10-06
Use the Aalen–Johansen estimator of the cumulative incidence function, updating the overall Kaplan–Meier estimator for either event:Right censoring changes subsequent risk sets, not the survival function by itself. Starting with the given estimates at , the complete calculation isThe middle event is of the competing type: it decreases overall survival while leaving the disease cumulative incidence function unchanged at that instant. The event-free intervals leave every estimate and risk set unchanged.
At the final time, both the event subject and the subject censored at that time are in the just-before risk set, so its denominator is eight. This is the usual event-before-censoring convention for recorded ties. After the event and right censoring, six subjects remain at risk. ConsequentlyThe nine numbered source items are the inputs to this single calculation, not nine further questions.