Definitionadvanced
Schoenfeld residuals
Also called scaled Schoenfeld residuals.
For each event, the covariate of the unit that failed minus its risk-weighted mean over the risk set. A trend in time signals a failure of proportional hazards.
Schoenfeld residuals are the residuals of a fitted Cox model that belong to the event times, not to the subjects. At each event, they compare the covariate vector of the subject that had the event with the average covariate vector of the risk set, weighted by the relative risks . Their sum is the score of the partial likelihood, so they sum to zero at the estimate. If the proportional hazards assumption holds, they show no trend in time. Plotted against time after scaling, they estimate how the coefficient of a covariate changes in time, and a regression on a function of time gives a test of proportional hazards.
Definition
Fit a Cox model to data , , with , and let be a coefficient vector, usually the estimate . For a time let be the risk set and
the weighted mean and covariance of the covariates over the risk set. Under the model, if one event happens at , the subject that has it is with probability , so and are the mean and covariance of the covariate of the subject that has the event.
Schoenfeld residual. For each subject with an event (),
There is one residual vector per event and none for a censored subject. With tied events, each of the subjects at gets its own residual against the same , which matches the Breslow rule for ties.
They sum to the score. For every , , the score of the Breslow partial likelihood. Proof. The log partial likelihood is , and the gradient of the term is . So at the estimate, where , the residuals sum to the zero vector. They are not independent, but they are nearly uncorrelated across event times, as the increments of a martingale are.
Scaled Schoenfeld residuals. Let be the number of events and the inverse of the information matrix. Grambsch and Therneau (1994) define
The exact scaling is . Since , replacing each by the average gives the form above, which is stable even when one risk set is small. If the coefficient changes in time, as for a known function , then . A smooth of against time, or against or the rank of , estimates . A flat line is what proportional hazards predicts.
The test of proportional hazards. The score test of in , for one covariate, is close to
with and their mean over the events. is approximately under proportional hazards, and it is times the squared correlation statistic between the scaled residuals and in the sense of Grambsch and Therneau. The exact score test replaces by the full information of .
Examples and non-examples
A hand example. Five subjects with times and . There are four events, so four residuals.
- At the risk-set means are at times , so the residuals are . They sum to .
- At the residuals are , which sum to . The scaled residuals, with and , are .
- The residual at time 5 is for every , because the risk set has one member. The last event time often gives a zero residual, and its scaled residual is itself.
The leukemia data. For the Gehan data with for placebo and the Breslow-ties fit , there are 30 residuals, and they sum to , zero up to rounding. At both events are on placebo and the weighted mean is , so both residuals are , and their scaled value is . The tests of proportional hazards give:
| above | p-value | exact score test | p-value | |
|---|---|---|---|---|
| 0.0187 | 0.891 | 0.0176 | 0.894 | |
| 0.321 | 0.571 | 0.348 | 0.555 |
There is no sign that the effect of placebo changes over the 23 weeks. The values were computed by the reference code of the partial likelihood page.
A model that is not proportional. If the hazard ratio of a treatment falls from 4 early to 1 late, the residuals of the treated subjects are positive among the early events and near zero or negative among the late ones. The scaled residuals then trend down from about toward , and the test with detects the trend when there are enough events. The frailty model gives one mechanism for such a decline.
Non-examples.
- Martingale residuals are not Schoenfeld residuals. They are defined per subject, , with the Breslow estimator, they exist for censored subjects, and they check the functional form of a covariate, not proportional hazards.
- Score residuals are per subject too. They add to each subject's Schoenfeld term the changes in over the times it was at risk, and they are used for influence and for robust variances.
- A raw difference of Kaplan-Meier curves is not a residual. Crossing curves suggest non-proportional hazards, but they do not adjust for the other covariates.
Related definitions
- Score and information. The residuals add up to the score , and is the information of the Breslow partial likelihood. At with one binary covariate the sum is of the log-rank test.
- Cumulative sums. The process , a sum of martingale-like increments, is the basis of the Lin, Wei and Ying tests of proportional hazards, which compare it with simulated paths under the model.
- Time-varying coefficients. The model is the alternative that the scaled residuals estimate. Fitting it with as an extra time-dependent covariate gives the exact score test of the table.
- Stratification. If a covariate fails the check, a common remedy is to stratify on it, so that each stratum has its own baseline hazard, as described on the Cox model page.
- Accelerated failure time. When the hazard ratio drifts in time but the survival curves look like stretched copies of each other, an accelerated failure time model may fit better.
References
- David Schoenfeld, Partial residuals for the proportional hazards regression model, Biometrika 69(1), 1982, pp. 239 to 241 (the definition of the residuals and their use to check proportional hazards)
- Patricia M. Grambsch and Terry M. Therneau, Proportional hazards tests and diagnostics based on weighted residuals, Biometrika 81(3), 1994, pp. 515 to 526 (the scaled residuals, their approximate expectation beta(t), and the score tests of proportional hazards)
- Terry M. Therneau and Patricia M. Grambsch, Modeling Survival Data, Extending the Cox Model, Springer, 2000, Chapter 6 (testing proportional hazards with the scaled Schoenfeld residuals, with worked examples and plots)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag V69XGW Edit this page History Report an error Markdown