Concept Architecture
Cox-Snell Residual for Checking Survival Curve Fit Before Extrapolation
Economic models of cancer and other chronic conditions often rest on survival curves fitted to trial data and then projected far beyond the end of follow-up. The Cox-Snell residual turns a fitted parametric survival model into one number per patient, and the plot built from those numbers shows whether the model reproduces the pattern of events actually observed. When the model is right the residuals should resemble a censored unit exponential sample, and the plot, built with the Nelson-Aalen estimator, is read through departures from its reference line. The plot belongs within NICE Decision Support Unit guidance on choosing survival curves, and it has clear limits for the extrapolated part of a curve.
From a fitted survival curve to one residual per patient
Observed minus fitted values do not work as residuals for censored, skewed survival times. Cox and Snell published a general definition of residuals in 1968 that was not limited to linear models, and Kay later used their approach to derive residuals for proportional hazards regression. For a time-to-event model the Cox-Snell residual of patient is the fitted cumulative hazard evaluated at that patient's own observed time, as follows.
where is the Cox-Snell residual for patient , is the observed time (an event time or a censoring time), are the patient's covariate values, such as treatment arm, is the cumulative hazard implied by the fitted model and is the corresponding fitted survival function. For a Cox proportional hazards model the same quantity is written , with the estimated cumulative baseline hazard and the estimated coefficients.
Each residual measures how much hazard the model says a patient had accumulated by the time that patient was last seen. It is never negative and is not symmetric around zero, so it does not behave like an ordinary residual in a regression plot.
Why a correct model yields unit exponential residuals
The reference distribution comes from a property that holds for any continuous survival time. If a random survival time has cumulative hazard , the transformed value follows an exponential distribution with mean 1. This follows because survival and cumulative hazard are linked by , so that the following holds.
where is any non-negative value, is the inverse of the cumulative hazard and is the survival function of the unit exponential distribution. When the fitted model is correct, is close to the true , so in the absence of censoring the residuals behave like draws from that distribution.
Censoring changes how the check has to be done. A censored patient's residual is only a lower bound on the value it would have reached, so the residuals form a censored sample from the unit exponential, and a histogram, mean or quantile plot of the raw values misleads when follow-up is incomplete. The usual remedy treats the residuals as survival times, keeps each patient's original event or censoring flag, and estimates their cumulative hazard nonparametrically. The unit exponential has a constant hazard of 1, so its cumulative hazard is a straight line through the origin with slope 1, and that line is the benchmark for the plot.
Building and reading the residual plot
The plot takes four steps once a candidate model has been fitted, by maximum likelihood estimation for a parametric model or by partial likelihood for a Cox model. The flexsurv package for R returns the residuals, and Stata's estat gofplot command draws the whole plot after streg or stcox.
1. Compute the residuals. Each patient's fitted cumulative hazard at the observed time is calculated from the model, including the patient's covariates.
2. Treat the residuals as survival times. The residuals are sorted and each one keeps its original event or censoring indicator.
3. Estimate their cumulative hazard. The Nelson-Aalen estimator is the usual choice, with minus the log of the Kaplan-Meier estimator as an alternative. The estimate is as follows.
where is the estimated cumulative hazard of the residuals at value , are the distinct residual values at which events occurred, is the number of events at and is the number of patients whose residual is at least .
4. Plot against the 45 degree line. is plotted against together with the line of slope 1 through the origin.
A departure from the line can be read in terms of the model's error. For patients who share the same covariate values, the cumulative hazard of the residuals is the true cumulative hazard re-expressed on the scale of the fitted one, as follows.
where is the cumulative hazard of the residuals at value , is the true cumulative hazard and is the inverse of the fitted cumulative hazard. Here a point above the line means that the model understates the cumulative hazard up to the corresponding time, and so overstates survival at that time; a point below the line means the reverse. The local slope of the plot reflects the ratio of the true to the fitted hazard at that time. A curve that bends steadily away from the line suggests the wrong hazard shape, for example a constant hazard fitted where the observed hazard rises, which the log-cumulative hazard plots recommended in NICE DSU guidance can then help to diagnose.
Worked example of an exponential curve fitted to eight patients
The figures in this example are illustrative. Eight patients in one trial arm are followed for up to 14 months; six die and two are censored. An exponential model, which assumes a constant hazard rate, is fitted. Its maximum likelihood estimate of the hazard is the number of events divided by the total time at risk, as follows.
where is the estimated monthly hazard, 6 is the number of deaths and 60 is the sum of the eight follow-up times in months. Under this model , so each residual is 0.1 times the observed time. The Nelson-Aalen column adds at each event residual and stays flat at censored ones.
| Patient | Time (months) | Event | Residual | At risk | Increment | Nelson-Aalen |
|---|---|---|---|---|---|---|
| 1 | 2 | Death | 0.2 | 8 | 1/8 = 0.125 | 0.125 |
| 2 | 3 | Death | 0.3 | 7 | 1/7 = 0.143 | 0.268 |
| 3 | 5 | Death | 0.5 | 6 | 1/6 = 0.167 | 0.435 |
| 4 | 6 | Censored | 0.6 | 5 | none | 0.435 |
| 5 | 8 | Death | 0.8 | 4 | 1/4 = 0.250 | 0.685 |
| 6 | 10 | Death | 1.0 | 3 | 1/3 = 0.333 | 1.018 |
| 7 | 12 | Censored | 1.2 | 2 | none | 1.018 |
| 8 | 14 | Death | 1.4 | 1 | 1/1 = 1.000 | 2.018 |
The value at the sixth residual, for example, is as follows.
where each fraction is one death divided by the number still at risk. The first five event points lie close to the line of slope 1 (0.125 against 0.2, 0.268 against 0.3, 0.435 against 0.5, 0.685 against 0.8 and 1.018 against 1.0), slightly below it early on, which would mean the constant hazard slightly overstates early deaths. The final point jumps to 2.018 against 1.4 because only one patient is still at risk, so a single death adds a full unit; the jump is consistent with right-tail noise and says little about the model.
The residuals also sum to 6, the number of deaths, which is a property of the exponential maximum likelihood fit, because the log-likelihood is maximised at , so . Under this fit the raw mean of the residuals always equals the proportion of patients with an event, here 6/8 = 0.75, so the mean carries no information on fit. With eight patients, the plot can do little more than rule out gross misfit, which is why such plots are read alongside the other checks set out below.
Where the residual plot sits in survival model selection for HTA
Survival curves set the state occupancy of a partitioned survival model, and the extrapolated tail often drives mean survival and the QALY gain. The NICE Decision Support Unit's Technical Support Document 14 (TSD 14), written by Latimer in 2011 and last updated in March 2013, sets out how fitted models should be justified when patient-level trial data are available. It names tests of residuals such as Cox-Snell, martingale or Schoenfeld residuals as possibly useful, while describing visual inspection, log-cumulative hazard plots and information criteria as particularly relevant, and it gives separate weight to external data and clinical validity for judging the extrapolated portion. Its review of past NICE appraisals found that tests of residuals were also occasionally undertaken.
Each check answers its own question, and they work together. The Akaike information criterion and the Bayesian information criterion rank candidate distributions against each other, so the best-ranked model can still fit poorly if every candidate does; the AIC page sets out how TSD 14 and the NICE manual treat these criteria. A Cox-Snell plot looks at one model at a time and asks whether its goodness of fit is adequate in absolute terms across the whole observed period.
| Check | What it assesses | Covers the extrapolated period |
|---|---|---|
| Log-cumulative hazard plot | Whether the hazard looks constant, monotonic or non-monotonic, and whether hazards are proportional | No |
| Cox-Snell residual plot | Overall fit of one model, allowing for censoring | No |
| External data and clinical opinion | Plausibility of the projected tail | Yes |
TSD 14 states that visual inspection, log-cumulative hazard plots and AIC and BIC address internal validity only, and that when substantial extrapolation is needed the predictions should be validated by other means. A residual plot is confined to the observed data in the same way.
Choices that change what the plot shows
Several analysis choices change the look of the plot without any change in the underlying data. They matter most when a plot is used to separate noise from misfit.
The fitted parameters are themselves estimates. The documentation for Stata's Cox model notes that the unit exponential result holds only when the true parameters are used, so deviations from the line can partly reflect estimation uncertainty, especially in small samples and in the right tail, where prior events and censoring have reduced the effective sample. The estimator of the residuals' cumulative hazard is a second choice. Stata uses the Nelson-Aalen estimator by default after streg and stcox and offers minus the log of the Kaplan-Meier estimator as an option, so a report should say which was used.
The model structure matters as well. When arms are fitted separately, as TSD 14 allows when hazards are not proportional, each arm has its own residuals and its own plot. When treatment enters as a covariate, the residuals use each patient's covariate values, and Stata's estat gofplot can draw a separate curve for each group, so a misfit confined to one arm is not averaged away in a pooled plot. For flexible parametric models the residual is still the fitted cumulative hazard, and the flexsurv residual function accepts spline models as well as standard distributions.
What the plot cannot show
The limits of a Cox-Snell plot matter most where economic models lean on it. It describes only the observed follow-up. TSD 21 on flexible methods, by Rutherford and colleagues, states that a good fit within the range of the data may still lead to implausible extrapolations, and a plot of the observed residuals can say nothing about the tail of the curve beyond the trial.
The plot also gives an overall verdict without a diagnosis. A bend away from the line shows that something is wrong but not whether the cause is the distribution, a violated proportional hazards assumption or a missing covariate. It offers no formal test statistic either, so judging how close is close enough remains a matter of judgement. Each event adds one step to the plot, so the plot carries most information where events are numerous, while its right-hand end, closest to the period that matters for extrapolation, rests on the few patients still at risk and is the noisiest part.
One misreading recurs in practice, namely comparing the raw residuals with an exponential distribution without allowing for censoring, which can make a well-fitting model look poor, as the residual mean of 0.75 in the worked example shows.
Cox-Snell, martingale, deviance and Schoenfeld residuals
The Cox-Snell residual is one of a small family of survival residuals, and the martingale and deviance residuals are built from it. Each member suits a different diagnostic task.
The martingale residual is the event indicator minus the Cox-Snell residual, , where is 1 for an event and 0 for censoring; it compares observed with expected events for each patient and is used to examine the functional form of a covariate. The deviance residual rescales the martingale residual so that it is symmetric about zero, which makes it the preferred choice for identifying outlying patients. The Schoenfeld residual, defined separately at each event time, is used in Cox models to check and test the proportional hazards assumption. Of the four, only the Cox-Snell plot compares the whole fitted model with a fixed reference distribution, which is why it is the residual suited to judging the overall fit of each candidate parametric curve.
Sources
- Collett D. Modelling Survival Data in Medical Research. 3rd ed. Boca Raton: CRC Press; 2015.
- Cox DR, Snell EJ. A general definition of residuals. Journal of the Royal Statistical Society: Series B (Methodological). 1968;30(2):248-265. https://doi.org/10.1111/j.2517-6161.1968.tb00724.x
- Jackson C. flexsurv: Flexible parametric survival and multi-state models. R package version 2.3.2. 2024. Help page coxsnell_flexsurvreg. https://search.r-project.org/CRAN/refmans/flexsurv/html/coxsnell_flexsurvreg.html
- Latimer N. NICE DSU Technical Support Document 14: Survival analysis for economic evaluations alongside clinical trials, extrapolation with patient-level data. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; 2011, last updated March 2013. Sections 3, 3.1, 3.2, 3.5, 3.6, 4.4 and 6.1. https://doi.org/10.15131/shef.data.33745843
- Rutherford MJ, Lambert PC, Sweeting MJ, Pennington B, Crowther MJ, Abrams KR, Latimer NR. NICE DSU Technical Support Document 21: Flexible methods for survival analysis. Sheffield: Decision Support Unit, ScHARR, University of Sheffield; 2020 (updated March 2022). Section 3.2.2. https://doi.org/10.15131/shef.data.33849118
- StataCorp. Stata Survival Analysis Reference Manual, Release 19. Entries streg postestimation, stcox postestimation and estat gofplot. College Station, TX: Stata Press; 2025. https://www.stata.com/manuals/ststregpostestimation.pdf, https://www.stata.com/manuals/ststcoxpostestimation.pdf, https://www.stata.com/manuals/stestatgofplot.pdf
- Xue Y, Schifano ED. Diagnostics for the Cox model. Communications for Statistical Applications and Methods. 2017;24(6):583-604. https://doi.org/10.29220/CSAM.2017.24.6.583
Related Concepts (6)
Institutional Perspectives (1)
- NICE Decision Support Unit
Cox-Snell Residuals Among Further Tests of Survival Model Fit
TSD 14 lists tests of residuals such as Cox-Snell, martingale or Schoenfeld residuals among further statistical tests that may be useful when assessing fitted survival models, beside the methods it treats as particularly relevant. Its model selection algorithm begins with log-cumulative hazard plots or suitable residual plots to judge the type of hazard and whether proportional hazards hold. Its review of NICE appraisals found tests of residuals only occasionally, and it stresses that fit to the observed data says nothing about the extrapolated portion, which needs external data and clinical validity.
NICE DSU Technical Support Document 14: Survival analysis for economic evaluations alongside clinical trials, extrapolation with patient-level data (Latimer, June 2011, last updated March 2013), sections 3, 3.5, 3.6, 4.4 and 6.1View source →
Library
Publications
3
Diagnostics for the Cox model — Xue Y, Schifano ED, Vol. 24, No. 6, pp. 583-604 ed., 2017 (Communications for Statistical Applications and Methods)
Review of diagnostics for the Cox model, including the Cox-Snell residual computed from the estimated cumulative baseline hazard, which notes that the residuals are no longer approximately unit exponential when censoring is present.
Journal ArticleView source →A general definition of residuals — Cox DR, Snell EJ, Vol. 30, No. 2, pp. 248-265 ed., 1968 (Journal of the Royal Statistical Society: Series B (Methodological))
Paper giving a more general definition of residuals than the usual one tied to linear models and finding some of their asymptotic properties, cited as the origin of the Cox-Snell residual.
Journal ArticleView source →NICE DSU Technical Support Document 15: Cost-effectiveness modelling using patient-level simulation — Davis, Stevenson, Tappenden & Wailoo, TSD 15 ed., 2014 (NICE Decision Support Unit (University of Sheffield))
Guidance on individual patient-level (microsimulation) cost-effectiveness modelling — when to use it in preference to cohort models, how to structure it, and how to handle the associated computational and uncertainty challenges.
Tools & Resources
2
flexsurv: Flexible parametric survival and multi-state models — Jackson C, R package version 2.3.2; help pages coxsnell_flexsurvreg, flexsurvreg and flexsurvspline ed., 2024 (CRAN)
Documentation for the flexsurv R package, cited for the coxsnell_flexsurvreg function, which returns Cox-Snell residuals defined as the fitted cumulative hazard at each data point for models fitted by flexsurvreg or flexsurvspline, and for the flexsurvreg and flexsurvspline help pages.
Web (Open Access)View source →Stata Survival Analysis Reference Manual, Release 19 — StataCorp, Entries cited: streg postestimation, stcox postestimation, estat gofplot, stset, sts, streg and Survival analysis ed., 2025 (Stata Press)
Stata survival analysis manual, cited for the postestimation entries that define the Cox-Snell residual as the estimated cumulative hazard from the fitted model and describe estat gofplot for plotting the cumulative hazard of these residuals after streg or stcox, and for the stset, sts and streg entries.
Frequently Asked Questions (7)
What is a cox snell residual?
A Cox-Snell residual is a survival model's fitted cumulative hazard at a patient's observed time, used to check overall fit against a unit exponential.
Source: Cox & Snell 1968
What is a Cox-Snell residual?
A Cox-Snell residual is a residual used to check the overall fit of a survival model, defined so that, if the fitted model is correct, the residuals should follow a standard exponential distribution. Proposed by Cox and Snell, these residuals transform each observation using the fitted model's cumulative hazard, and their agreement with the expected exponential distribution is examined to assess whether the model fits the data adequately. They provide a general diagnostic for survival model fit.
Source: Cox & Snell 1968
What goodness-of-fit diagnostic is a Cox-Snell residual?
A Cox-Snell residual is a diagnostic quantity used to assess how well a survival model fits the observed data overall. It is derived from the estimated cumulative hazard for each individual at their event or censoring time. If the model fits well, these residuals should behave like a sample from a standard exponential distribution, which can be checked graphically. Departures from that expected pattern signal that the chosen model does not describe the data adequately. The method gives a general check of fit rather than a test of any single assumption.
Source: Collett 2015
How are Cox-Snell residuals used?
Cox-Snell residuals are used by computing them from the fitted survival model, then checking whether they follow a standard exponential distribution, which they should if the model fits well. This is typically done by treating the residuals as a survival sample, estimating their cumulative hazard, and plotting it against the residuals: a straight line through the origin with slope one indicates good fit, while departures indicate poor fit. The comparison with the expected exponential distribution thus provides a graphical check of the model's overall adequacy.
Source: Cox & Snell 1968
Why should Cox-Snell residuals follow an exponential distribution?
Cox-Snell residuals should follow a standard exponential distribution when the model is correct because they are constructed from the model's cumulative hazard evaluated at each observation, and the cumulative hazard of the true survival distribution, evaluated at the event times, has this property. So if the fitted model matches the true one, the residuals inherit the standard exponential distribution. Departure from it indicates that the model does not fit, since the transformation would not produce exponential residuals if the model were wrong.
Source: Cox & Snell 1968
What do Cox-Snell residuals reveal about model fit?
Cox-Snell residuals reveal whether a survival model fits the data overall: agreement with the standard exponential distribution, shown by a straight cumulative-hazard plot with slope one, indicates good fit, while systematic departures indicate misfit, suggesting the model's form is inappropriate. They provide an overall diagnostic rather than pinpointing the cause of misfit, so they show whether the model fits adequately but may need to be supplemented by other residuals or checks to identify specific problems such as non-proportional hazards.
Source: Collett 2015
What are the limitations of Cox-Snell residuals?
Cox-Snell residuals assess overall model fit but do not identify the specific nature or source of any misfit, so a poor plot indicates a problem without showing whether it is due to the wrong distribution, non-proportional hazards, or omitted covariates. Their interpretation can be affected by censoring, and the plots can be hard to read near the tails. They are therefore used alongside other diagnostics that target particular assumptions, so Cox-Snell residuals provide a general check of fit rather than a complete diagnosis.
Source: Cox & Snell 1968
Trust Record
Verified by Dr Darrin Baines
British health economist
Professional identity: darrinbaines.org
Verification date: 10 Oct 2026
Content version: 1.0.2
Canonical Identity
- Persistent URI
- https://healtheconomics.wiki/concept/cox-snell-residual
- Term code
- HE-EM-SM-009
Stable URI · Machine-readable · Resolvable · CC BY 4.0
