Why Model Nonproportional Hazards?
In a Cox proportional hazards model, a covariate has a constant hazard ratio over time, conditional on the other covariates. That restriction can be unsuitable when a covariate’s association with the event becomes stronger, weaker, or changes direction over follow-up. The earlier material on diagnosing proportional hazards helps identify such patterns; the next question is how to model them.
Two approaches address different structures. A stratified Cox model allows baseline hazards to differ across groups while retaining shared covariate coefficients. A time-varying-coefficient model allows a covariate’s coefficient, and hence its hazard ratio, to change with event time. They are not interchangeable: one accommodates group-specific baseline risk, while the other represents a changing covariate effect.
Here \(T_i\) is subject \(i\)'s event time, \(x_i\) is a covariate value, and \(h_i(t)\) is the subject's hazard at time \(t\), conditional on being event-free just before \(t\). A time-varying coefficient means the effect of a covariate depends on \(t\); it does not mean the covariate itself changes over time. The latter is a time-varying covariate, a different feature of the model.
Stratified Cox Models
Suppose subjects belong to one of \(G\) strata, indexed by \(g_i\), such as hospitals or regions. A stratified Cox model is
Each stratum has its own unspecified baseline hazard \(h_{0,g}(t)\), but the covariate vector \(x_i\) has a common coefficient vector \(\beta\) across strata. Thus the model does not estimate a single coefficient for stratum membership. Instead, it permits the underlying hazard pattern to differ freely between strata.
The partial likelihood makes the role of stratification explicit. At an event time \(t_k\) in stratum \(g\), the comparison is among subjects in that stratum who are at risk just before \(t_k\). If \(i_k\) experiences the event, the contribution, in the absence of tied events, is
where \(R_g(t_k)\) is the risk set in stratum \(g\). The full partial likelihood multiplies these contributions across events. Events in different strata therefore use separate risk sets, while the common \(\beta\) is estimated from the within-stratum comparisons pooled across strata. This requires covariate contrasts to be available within strata; a covariate that is constant within every stratum cannot have its coefficient identified this way.
Stratification is useful when a categorical factor is a nuisance variable with substantially different baseline hazard patterns, but the effects of the covariates of interest are plausibly shared. It avoids forcing proportional baseline hazards across strata. It does not solve nonproportionality of a covariate effect that is itself changing over time.
Worked Example: A Stratified Comparison Across Hospitals
Consider a hypothetical study of time to readmission in two hospitals. Hospital is used as the stratum, and treatment \(x_i\) is coded 1 for treated and 0 for untreated. A fitted stratified Cox model gives \(\hat\beta=-0.400\). Assume subjects are independent, censoring is conditionally noninformative, treatment varies within each hospital, and the treatment effect is reasonably common across hospitals and proportional over time. The separate baseline hazards allow the hospitals to have different underlying readmission patterns.
At one event time in Hospital A, suppose the risk set consists of the treated subject who has the event, another treated subject, and one untreated subject. The event's partial-likelihood contribution at \(\hat\beta=-0.400\) is
The fitted treatment hazard ratio is \(\exp(-0.400)=0.6703\). Conditional on the model and covariates, the estimated instantaneous readmission hazard for treated subjects is about 0.670 times that for untreated subjects at the same time within either hospital. This is a relative hazard interpretation, not a ratio of readmission probabilities. The stratum-specific baselines mean that the model does not claim the two hospitals have equal absolute hazards or survival probabilities.
Time-Varying Coefficients
When the covariate effect itself varies with event time, write the model as
Here \(\beta(t)\) is a vector of coefficient functions. For a binary covariate \(x\), the hazard ratio comparing \(x=1\) with \(x=0\), at time \(t\) and with other covariates held fixed, is \(\exp\{\beta_x(t)\}\). A common specification is to let a coefficient vary with a chosen time function \(g(t)\):
For example, \(g(t)=\log(t/c)\), for a positive reference time \(c\), makes \(\beta_{x0}\) the log hazard ratio at \(t=c\). The coefficient \(\beta_{x1}\) describes how the log hazard ratio changes with \(g(t)\). A piecewise-constant coefficient is another option when distinct follow-up periods are substantively meaningful. The chosen function should be justified by the intended pattern and the available data; a complicated coefficient function cannot be reliably estimated without enough events across time.
The partial-likelihood logic still compares the event subject with the appropriate risk set, but the risk score at event time \(t_k\) uses the coefficient at that time. With one covariate, an untied event contributes
A time-varying coefficient is identified through covariate contrasts in risk sets at different event times. If the covariate effect is allowed to vary freely at every time, there may be too little information to estimate it; practical models impose a structured function or a small number of time intervals. Interpretation should report hazard ratios at meaningful times or intervals rather than presenting one constant hazard ratio.
Worked Example: A Treatment Effect That Changes With Time
In a hypothetical trial with event time measured in days, suppose the fitted treatment coefficient is \(\beta_x(t)=-0.400+0.250\log(t/30)\). Treatment is coded 1 and control 0. Assume the functional form is suitable, both groups contribute subjects to risk sets over the times considered, censoring is conditionally noninformative, and other model components are correctly specified.
At day 15, \(g(15)=\log(15/30)=\log(0.5)=-0.6931\). Therefore,
At day 30, \(g(30)=0\), so \(\beta_x(30)=-0.400\) and \(HR(30)=\exp(-0.400)=0.6703\). At day 60, \(g(60)=\log(2)=0.6931\), giving
The fitted treatment hazard is lower than the control hazard at each of these times, but the estimated relative difference becomes smaller over follow-up. These are conditional instantaneous hazard comparisons, not claims that treatment changes event probabilities by the same percentages.
Predictions and What Each Model Can Compare
A stratified model supports stratum-specific predictions because each stratum has its own baseline survival. If \(\hat H_{0,g}(t)\) is an estimated cumulative baseline hazard in stratum \(g\), the predicted survival for a covariate profile \(x\) in that stratum is
The model can compare covariate profiles within a stratum using the shared hazard ratios, and can predict survival for each profile in a specified stratum. It does not provide a single stratum hazard ratio: the baseline hazards can differ in ways that are not summarized by a constant multiplier. Cross-stratum survival comparisons are possible when the stratum and covariate profiles are specified, but their predictions rely on the estimated stratum-specific baselines, not on an estimated coefficient for stratum membership.
For a time-varying coefficient, the survival prediction follows by accumulating the time-specific hazard. For fixed covariates \(x\), the model implies
This follows from the standard hazard-survival relationship: the cumulative hazard is the integral of the hazard, and survival is the exponential of its negative. When the coefficient changes over time, it is generally incorrect to multiply a single baseline cumulative hazard by one constant hazard ratio. Prediction requires the time-specific effect across the whole interval. The resulting predictions can compare survival for specified covariate profiles, given the fitted baseline hazard and coefficient function.
Worked Example: Survival Prediction With a Piecewise Effect
Suppose, hypothetically, that the baseline cumulative hazard increases by 0.120 from day 0 to day 30 and by 0.180 from day 30 to day 60. For illustration, assume the treatment hazard ratio is constant at 0.800 in the first interval and 1.400 in the second. These assumptions define a piecewise model; they do not assert that either interval’s effect is constant in every application.
For the untreated profile, the cumulative hazard through day 60 is \(0.120+0.180=0.300\), so
For the treated profile, weight each baseline hazard increment by that interval’s hazard ratio. The cumulative hazard is \(0.120(0.800)+0.180(1.400)=0.096+0.252=0.348\), giving
Under these hypothetical model values, predicted survival to day 60 is 0.706 for the treated profile and 0.741 for the untreated profile. The changing hazard ratio is reflected over both intervals. These are model-based survival predictions for the specified profiles; they do not, by themselves, establish a causal treatment effect.
Choosing an Approach and Checking Its Assumptions
Use stratification when the concern is that groups have different baseline hazard shapes and the covariate effects of interest can reasonably be treated as common and proportional. Use time-varying coefficients when a particular covariate’s hazard ratio changes over follow-up and a structured time function can represent that change. Both features can be included together if needed, with stratum-specific baselines and time-varying coefficients, but this uses more information and requires adequate event data within strata and across time.
| Model feature | What varies over time or group | Useful comparisons | Prediction implication |
|---|---|---|---|
| Stratified Cox | Baseline hazard varies by stratum; covariate coefficients are shared | Covariate contrasts within strata | Use the baseline for the specified stratum |
| Time-varying coefficient | A covariate effect varies with event time | Covariate contrasts at specified times | Accumulate the hazard using the coefficient over time |
| Ordinary Cox model | One baseline hazard and constant covariate coefficients | Covariate contrasts with constant hazard ratios | Use one constant relative hazard multiplier |
These models still require appropriate specification of the covariates and censoring mechanism. In particular, the usual interpretation requires censoring to be noninformative conditional on the modeled information, and the risk sets must provide enough covariate variation for the effects to be estimated. A time-varying coefficient is not automatically causal: causal interpretation requires additional assumptions and a design that supports it.
Common Pitfall
Wrong reasoning: “The proportional-hazards diagnostic flags hospital, so I should put a hospital coefficient in the model; that will fix the problem.” A single hospital coefficient imposes a constant hazard ratio between hospitals, which may not represent different baseline hazard shapes. It also does not allow the treatment effect to vary over time.
Correction: Identify which part of the model is nonproportional. If hospital-specific baseline patterns are the issue and treatment effects are plausibly shared, stratify by hospital. If the treatment hazard ratio changes over time, model its coefficient as a function of time and report time-specific comparisons. Then check whether the chosen model’s assumptions and data support those comparisons.
Check Your Understanding
Answer each question by identifying the model feature and the comparison it supports.
- In a stratified Cox model, why are events compared only with subjects in the same stratum’s risk set?
- A treatment coefficient is \(-0.20+0.10\log(t/10)\). What is the treatment hazard ratio at \(t=10\), and what does it compare?
- Can a stratified Cox model estimate a hazard ratio for a covariate that is constant within every stratum? Explain.
- Why is it generally incorrect to predict survival with a time-varying coefficient by multiplying the entire baseline cumulative hazard by the hazard ratio at the prediction time?
- Describe one situation suited to stratification and one suited to a time-varying coefficient.