Why Transform Survival Times Into Residuals?
A fitted survival model assigns each subject a conditional survival distribution, given their covariates. A useful overall diagnostic asks whether observed event and censoring times behave as that model predicts, without requiring the model to have a single simple time scale. Cox–Snell residuals provide such a scale: if the model is correct, the residual event times follow a unit-exponential distribution. The key is to compare their estimated cumulative hazard with the reference cumulative hazard \(r\), while retaining right-censored observations as censored.
This is a diagnostic of overall fit, not a replacement for examining individual model assumptions. In particular, it does not by itself identify whether a departure comes from the baseline hazard, covariate effects, functional form, or another source of misspecification.
Definition and Reference Distribution
Here \(T_i\) is the event time and \(C_i\) is the censoring time. The cumulative hazard and survival function satisfy \(H(t\mid x)=-\log S(t\mid x)\). For a parametric model, calculate this quantity from its fitted conditional distribution. For a proportional-hazards Cox model, the fitted cumulative hazard is commonly obtained as the fitted baseline cumulative hazard multiplied by the subject's relative hazard.
The reference distribution follows from a probability transformation. Suppose the true conditional survival model is continuous and correctly specified. For an uncensored event time \(T_i\), set \(R_i=H(T_i\mid x_i)\). For any \(r\ge0\), monotonicity of \(H\) gives
Therefore \(R_i\mid x_i\sim\operatorname{Exp}(1)\), with density \(\exp(-r)\) for \(r\ge0\), and the same reference distribution applies across covariate values. In practice, the fitted residuals use estimated parameters, so their distribution is only approximately unit exponential in a finite sample.
Conditions for Interpreting the Diagnostic
The transformation is most directly justified when the conditional event-time distribution is correctly specified, the cumulative hazard is evaluated for the subject's covariates and at the observed time, and the event-time distribution is continuous. Right censoring must be noninformative conditional on the covariates used in the model: after conditioning on those covariates, censoring should not convey additional information about the event time. Subjects should also be analyzed with their appropriate observed follow-up and event indicators.
The fitted survival function or cumulative hazard must be valid and nondecreasing in time. In the Cox model, use the fitted baseline cumulative hazard from the model and the same coefficient and tie-handling conventions used in fitting. With time-varying covariates, the relevant cumulative hazard is accumulated along the subject's covariate history; simply multiplying a baseline value by one fixed risk score is not generally adequate.
If these conditions fail, the residual plot can reveal a mismatch, but it cannot establish which assumption failed. Conversely, a plot close to the reference does not prove the model is correct: limited sample size, heavy censoring, or compensating errors can conceal departures.
Calculating Residuals and Assessing Fit
Once each \(r_i\) and \(\delta_i\) has been calculated, regard them as a right-censored survival data set. Estimate its cumulative hazard, often with the Nelson–Aalen estimator, and plot that estimate against residual time \(r\). The unit-exponential reference has cumulative hazard \(H_{\mathrm{ref}}(r)=r\), so the benchmark is a 45-degree line. A close track is consistent with overall fit; systematic curvature or persistent separation from the line suggests a discrepancy.
In this formula, \(r_{(j)}\) is a distinct residual event time, \(d_j\) is the number of residual events at that time, and \(Y_j\) is the number of residual observations still at risk immediately before it. Censored residuals reduce later risk sets but do not contribute an event increment. This is essential: treating every censored follow-up as an event makes the estimated cumulative hazard too large.
Worked Example: Residuals From a Weibull Model
Suppose a hypothetical fitted Weibull proportional-hazards model has conditional cumulative hazard \(\widehat H(t\mid x)=(t/10)^{1.5}\exp(\eta)\), where time is measured in months and \(\eta\) is the fitted linear predictor. For one subject, the observed time is 8 months, the event occurred, and \(\eta=\log(1.5)\). Calculate the Cox–Snell residual.
Substitute the observed time and predictor into the fitted cumulative hazard:
The subject contributes an event residual of approximately 1.073. The residual is on the cumulative-hazard scale, not in months.
For comparison, suppose another subject is censored at 6 months with \(\eta=\log(0.8)\). Their residual is
This is recorded as a censored residual at 0.3718. The calculation does not turn the subject's censoring into an event.
Worked Example: Residual From a Cox Model
Suppose a hypothetical Cox model has fitted baseline cumulative hazard increments of 0.10, 0.15, and 0.20 at event times up to 4 years. Thus, the fitted baseline cumulative hazard at 4 years is \(0.10+0.15+0.20=0.45\). A subject has linear predictor \(x_i^\mathsf{T}\widehat\beta=0.40\), and an event is observed at 4 years. Calculate the residual.
The fitted relative hazard is \(\exp(0.40)\approx1.4918\). Applying the Cox-model formula,
The event contributes a residual of approximately 0.6713. The subject's relative hazard is greater than 1, so the fitted cumulative hazard accumulated by 4 years is greater than the baseline cumulative hazard. If the same subject instead had been censored at 4 years, the calculated value would be recorded as censored at 0.6713.
Worked Example: Estimating the Residual Cumulative Hazard
Consider five hypothetical residual records, already calculated from a fitted model: event at 0.20, censoring at 0.35, event at 0.50, event at 0.80, and censoring at 1.10. Calculate the Nelson–Aalen cumulative hazard at the three event times.
At residual time 0.20, all five observations are at risk and one event occurs, so the increment is \(1/5=0.2000\). At 0.50, the observation censored at 0.35 has left the risk set, leaving three at risk; the increment is \(1/3=0.3333\). At 0.80, two remain at risk and one event occurs, giving an increment of \(1/2=0.5000\). The cumulative estimates are therefore
The corresponding reference values are 0.20, 0.50, and 0.80. The final estimate is above its reference value, but this tiny data set is far too small to support a strong conclusion. In a larger data set, assess the overall shape and uncertainty rather than treating one point as decisive.
Reading the Plot and Comparing Approaches
The diagnostic asks whether the residual event process is compatible with a unit-exponential distribution. If the estimated cumulative hazard lies broadly near the identity line, the model's overall survival distribution is reasonably consistent with the data. If it is systematically above the line over a range, events have accumulated faster on the residual scale than the reference predicts; if it is below, they have accumulated more slowly. Curvature can indicate that the discrepancy changes across residual time. These patterns are clues, not unique diagnoses.
Cox–Snell residuals offer a common scale for parametric and Cox models. For a parametric model, the fitted conditional cumulative hazard comes from the chosen distribution and estimated parameters. For a Cox model, it comes from the estimated baseline cumulative hazard and fitted relative hazards. The same residual plot can then be used for either. By contrast, inspecting a parametric survival curve against a nonparametric curve retains the original time scale and can be easier to explain, but does not provide this common exponential reference. Other residual types answer more targeted questions; they should not be mistaken for this overall cumulative-hazard check.
Because residuals depend on estimated model parameters, ordinary reference lines do not account for all sampling uncertainty. A visual assessment is usually more informative when accompanied by uncertainty bands or a simulation-based check that repeats the full fitting and diagnostic procedure. A bootstrap or parametric simulation should refit the model in each replicate; otherwise, it omits parameter-estimation variability. Heavy censoring makes the tail of the residual cumulative-hazard curve especially uncertain, since few observations remain at risk there.
Common Mistakes and Failure Modes
- Counting censored residuals as events. A censoring time gives a lower bound on the unobserved event residual. Keep its event indicator as zero; it leaves later risk sets but adds no event increment.
- Comparing residual times directly with exponential event times without accounting for censoring. The appropriate comparison uses a survival-data cumulative-hazard estimate, not a histogram that treats censored values as fully observed events.
- Using the baseline cumulative hazard alone for every Cox-model subject. For a fixed-covariate proportional-hazards model, multiply the baseline cumulative hazard by \(\exp(x_i^\mathsf{T}\widehat\beta)\) before evaluating the residual.
- Calling a near-diagonal plot proof of correctness. The diagnostic has limited power, particularly with few events or extensive censoring. It is evidence about fit, not a guarantee.
- Assigning a single cause to a departure. A discrepancy may reflect the baseline distribution, covariate specification, omitted predictors, or violated censoring assumptions. Further checks are needed to distinguish them.
Check Your Understanding
Answer each question, then check the brief solutions below.
- A subject is censored at time \(t\). What two pieces of information are recorded for the Cox–Snell residual?
- A fitted model gives \(\widehat H(t\mid x)=0.60\) at an observed event time. What residual is recorded, and what is its event status?
- At a residual event time, 8 observations are at risk and 2 events occur. What is the Nelson–Aalen increment?
- What does the unit-exponential reference cumulative hazard equal at residual time \(r=1.4\)?
- Why does a plot near the reference line not prove that every component of the survival model is correct?
Solutions. (1) Record \(r=\widehat H(t\mid x)\) and retain the censoring indicator \(\delta=0\); the residual is censored. (2) The residual is 0.60 and is an event residual because an event was observed. (3) The increment is \(d/Y=2/8=0.25\). (4) It is \(H_{\mathrm{ref}}(1.4)=1.4\). (5) The diagnostic may have limited power, especially with few events or heavy censoring, and different model errors can be difficult to distinguish from this plot alone.