Why Diagnose Proportional Hazards?
A Cox proportional-hazards model summarizes a covariate effect with a hazard ratio that is constant over time. That assumption can be questionable when a treatment effect begins only after a delay or changes during follow-up. Schoenfeld residuals provide an event-time diagnostic: they compare the covariate value for the subject who experienced an event with its risk-set expectation under the fitted model. A systematic pattern in those residuals can signal that the fitted constant-effect summary is inadequate.
The diagnostic is evidence about model compatibility, not a device that automatically chooses the next analysis. In a trial, a pattern noticed after examining the data may help explain results or motivate sensitivity analyses. It does not, by itself, justify replacing a prespecified confirmatory test with whichever test looks most favorable.
Model and Residual Definition
For a subject with covariate vector \(Z\), the Cox proportional-hazards model is
where \(h_0(t)\) is an unspecified baseline hazard and \(\beta\) is a vector of constant log hazard ratios. For a binary treatment indicator, for example, \(\exp(\beta)\) is the treatment-to-control hazard ratio, conditional on the model covariates. Proportional hazards means this ratio does not vary with time.
The usual interpretation of the fitted model and its residual diagnostics relies on a correctly specified relative-risk form, suitable handling of ties, and censoring that is independent of the event time conditional on the included covariates. The observed event and censoring times must be adequately recorded. A residual pattern can reflect a time-varying coefficient, but it can also arise from omitted covariates, an incorrect functional form, influential observations, or chance.
The raw residual is defined at an event, not at every follow-up time. Its expected value is approximately zero under the fitted model. A positive residual means the event subject's covariate value exceeded its risk-set expectation; a negative one means it was below expectation. For treatment coded 1 versus 0, a positive residual means an event occurred in a treated subject when the fitted model assigned less treated risk-set weight than the observed event indicates.
Scaled Schoenfeld residuals rescale these event-specific discrepancies using estimated model information. The scaling makes their time pattern more directly informative about changes in the coefficient, but exact conventions can differ by software. Some implementations display an estimated coefficient-over-time curve constructed from the fitted coefficient and scaled residuals. The scale, smoothing method, and time transformation should therefore be checked in the software documentation rather than assumed to be identical across programs.
Calculating and Reading Residuals
Worked Example: One Event-Time Residual
Suppose a hypothetical Cox model has a treatment coefficient \(\hat\beta=-0.400\), with treatment coded 1 and control coded 0. At one event time there are four treated and six control subjects at risk, and there are no ties. Calculate the treatment Schoenfeld residual if the event occurs in a treated subject.
Every subject in the risk set has relative-risk weight 1 if a control and \(\exp(-0.400)\) if treated. Thus the model-weighted treated proportion in the risk set is
The observed treatment indicator for the event subject is 1. Therefore,
This positive residual says that the event occurred in a treated subject even though treated subjects made up about 30.89% of the model-weighted risk set. It is one event-level discrepancy, not on its own evidence that the treatment effect changes over time. The same calculation for a control event at this risk set would give \(0-0.3089=-0.3089\).
To assess proportionality, examine a sequence of scaled residuals against event time or a prespecified transformation of time. Under a constant coefficient, there should be no systematic trend. A smoother may help reveal a broad pattern, but it can also be sensitive to the smoothing span, especially with few events. Points at late times often represent small risk sets and can be highly variable.
The plot is most useful as a diagnostic when interpreted with the number and timing of events, the risk-set sizes, and the fitted model in view. A curve that rises steadily across well-supported portions of follow-up is more suggestive than a sharp movement caused by a few late events. A flat plot does not prove proportionality: a diagnostic may have low power, particularly with limited events or a subtle time pattern.
Trend Tests and Their Meaning
A formal Schoenfeld-based test asks whether residuals are associated with a chosen function of event time. A linear trend in time is one possibility; rank or log-time transformations can target different patterns. In a model with several coefficients, tests may assess one coefficient at a time or test a group of time trends jointly. The test is therefore tied to the covariates and time function being tested.
The score-test logic can be stated generally. Let \(U\) be the vector of score components for the proposed time-trend terms, and let \(V\) be their estimated covariance matrix under the null hypothesis of no trend. The quadratic statistic is
Under the null, with regularity conditions and enough information, \(Q\) is approximately chi-square with degrees of freedom equal to the number of tested trend components. For one trend component this is approximately a chi-square statistic with one degree of freedom. Schoenfeld-residual tests use residual information to construct this kind of score test; the covariance calculation is not generally recovered by simply fitting an unweighted straight line to a plotted set of residuals.
Worked Example: Interpreting a One-Degree-of-Freedom Test
In a hypothetical randomized trial, a prespecified residual-based test for a linear trend in the treatment coefficient over follow-up reports \(Q=5.02\) on one degree of freedom. Calculate the approximate p-value and interpret it at a two-sided significance level of 0.05.
For one degree of freedom, a chi-square variable is the square of a standard normal variable. Therefore,
Because \(0.0251<0.05\), the test gives evidence against the null hypothesis of no linear residual trend under the fitted model and the selected time transformation. It does not prove a specific delayed-effect pattern, establish its clinical importance, or show that another test would be confirmatory. The plot and event support should be reviewed to understand what kind of departure may have produced the statistic.
A related way to express a particular hypothesis is to extend the Cox model with a time-varying coefficient, such as \(\beta(t)=\beta+\gamma g(t)\), and test \(H_0:\gamma=0\). This makes the tested pattern explicit through \(g(t)\). It is a useful complementary analysis, but the chosen function must be justified, and a Wald or likelihood-based test from the extended model is not automatically numerically identical to every residual-based test.
Worked Residual Trend and Its Limits
Worked Example: A Descriptive Linear Trend
Suppose a hypothetical diagnostic plot gives five scaled treatment residuals at event times 2, 3, 4, 5, and 6 months: \(-0.50,-0.30,0.00,0.20,0.30\). Calculate the least-squares descriptive slope of residual on time.
The mean time is \(\bar t=4\) months and the mean residual is \(\bar r=-0.06\). The deviations are \(t_j-\bar t=(-2,-1,0,1,2)\) months and \(r_j-\bar r=(-0.44,-0.24,0.06,0.26,0.36)\). Thus,
The descriptive slope is \(0.210\) scaled-residual units per month for these five points. It indicates an upward pattern in this small illustrative set. It is not a proportionality test: the residual values have been treated as ordinary independent observations in this slope calculation, and no residual-based covariance or test reference distribution has been used. The formal test requires the appropriate score and covariance calculation from the fitted survival model.
Plots and tests complement rather than replace each other. The test provides a calibrated measure of evidence for a specified trend under its assumptions; the plot can show direction, curvature, isolated events, and weak support at the extremes. A significant test need not imply a large or clinically important departure. A nonsignificant test does not establish that the hazard ratio is constant.
Diagnostics, Alternatives, and Common Pitfalls
When a diagnostic appears troubling, first check the analysis that produced it. Confirm the event and censoring coding, treatment coding, tie method, covariate specification, and risk sets. Look for a small number of events driving the apparent trend and for sparse risk sets near the end of follow-up. Compare the plot with the fitted model and clinically plausible time patterns. If the pattern changes greatly under reasonable smoothing choices or disappears when one influential event is excluded, describe that instability rather than presenting the trend as definitive.
The ordinary logrank test and weighted logrank tests answer treatment-comparison questions using different weighting choices; the earlier material on weighted logrank tests explains how their emphasis over time can differ. Schoenfeld diagnostics instead assess whether a fitted Cox-model coefficient appears compatible with constancy over time. A residual test is not itself a treatment-effect test designed to replace a prespecified logrank procedure. Conversely, a residual diagnostic does not rule out alternatives such as a prespecified weighted test when the design anticipated nonproportional effects.
The central pitfall is to inspect several residual plots, time transformations, or tests, then select the treatment test that happens to produce the smallest p-value and report it as if it had been planned. Such data-dependent selection can inflate the false-positive rate. Confirmatory test choice should be made in the design with its estimand, weighting strategy, and type I error control specified in advance. Diagnostic findings may inform interpretation and clearly labelled exploratory analyses, but they do not automatically validate a newly selected confirmatory procedure.
Schoenfeld methods also have limits. They are most directly interpretable within a correctly specified Cox model and may have low power when the event count is small. They diagnose association with the chosen time transformation rather than every possible departure from proportional hazards. Repeated use of multiple transformations or covariates raises multiplicity concerns. Finally, failure to reject a proportionality test is not proof that the assumption holds; it may reflect imprecision or a departure the selected diagnostic was not sensitive to.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In a binary-treatment Cox model, what does a positive treatment Schoenfeld residual at an event mean?
- A one-degree-of-freedom residual trend test reports \(Q=3.84\). What is its approximate p-value, and what does it test?
- Why is a visibly upward least-squares line through scaled residuals not, by itself, a formal proportionality test?
- A proportionality test is not significant. Is it valid to conclude that the treatment hazard ratio is constant throughout follow-up? Explain.
- After inspecting residual plots, an analyst chooses the weighted logrank test with the smallest observed p-value as the confirmatory test. Identify the problem.
Solutions. (1) The event occurred in a treated subject whose treatment indicator exceeded the model-weighted treated proportion in that event's risk set. The residual is a single discrepancy, not evidence by itself of a time trend. (2) \(P(\chi^2_1\ge3.84)\approx0.050\). It tests no association between the residual information and the specified time-trend function under the fitted model. (3) The ordinary line calculation does not account for the residual test's model-based covariance or its reference distribution. (4) No. Nonsignificance means the test did not find sufficient evidence against its null; limited events or an unsuitable time function may leave a departure undetected. (5) The choice is data-dependent and can inflate the false-positive rate. A confirmatory test and its error control should be prespecified; the selected test may be described as exploratory unless a valid selection procedure was planned.