Survival Analysis

Cox Regression with Stratified Baseline Hazards

A practical guide to stratified Cox proportional hazards regression, including stratum-specific baseline hazards, the stratified partial likelihood, interpretation, when to stratify, proportional-hazards diagnostics, SAS and R implementation, and a worked clinical-trial example.

Advanced 18 min read

What You'll Learn

  • Why a stratified Cox model uses a different baseline hazard in each stratum
  • The mathematical form of the stratified proportional hazards model
  • How stratification changes Cox risk sets and the partial likelihood
  • When stratification is preferable to modeling a factor as a covariate
  • Why the stratification variable does not receive an ordinary hazard ratio
  • How to implement stratification in SAS PROC PHREG and R survival::coxph
  • How to distinguish baseline-hazard heterogeneity from treatment-effect heterogeneity
  • Common clinical-trial mistakes involving stratification and clustering

Introduction

The Cox proportional hazards model is a central method for analyzing time-to-event endpoints such as overall survival, progression-free survival, time to relapse, and time to treatment discontinuation. Its appeal comes from the fact that the baseline hazard does not need to be specified parametrically.

The ordinary Cox model assumes a common baseline hazard for everyone after accounting for the covariates in the linear predictor:

\[ h(t\mid X)=h_0(t)\exp(X\beta) \]

That common-baseline assumption can be unnecessarily restrictive in a multicenter clinical trial. Patients from different regions, centers, disease stages, or other prespecified groups may have very different underlying event risks. A stratified Cox model allows those groups to have different baseline hazard functions while estimating a common set of regression coefficients for the covariates of scientific interest.

Key idea: A stratified Cox model changes the baseline hazard, not the basic interpretation of the regression coefficients. Each stratum gets its own unspecified baseline hazard, while the coefficients for the modeled covariates are pooled across strata unless interactions are explicitly introduced.

The Standard Cox Model

Let \(T\) denote event time and let \(X=(X_1,\ldots,X_p)\) be the covariate vector. The ordinary Cox model is:

\[ h(t\mid X)=h_0(t)\exp\left(\beta_1X_1+\cdots+\beta_pX_p\right) \]

For covariate \(X_j\), the corresponding hazard ratio for a one-unit increase is:

\[ HR_j=\exp(\beta_j) \]

For a binary treatment indicator, \(HR_{trt}\) compares the instantaneous event hazards for treatment versus control, conditional on the other modeled variables and under the proportional-hazards assumption.

Why Stratify the Baseline Hazard?

Suppose a Phase III trial enrolls patients from three geographic regions. Region may be strongly associated with prognosis because of differences in disease severity, background therapy, clinical practice, or referral patterns.

One approach is to put region into the linear predictor as a categorical covariate. That produces hazard ratios for the regions relative to a reference region and assumes those region effects are proportional over time.

A stratified model instead permits each region to have its own baseline hazard:

\[ h_k(t\mid X)=h_{0k}(t)\exp(X\beta), \qquad k=1,\ldots,K \]

The functions \(h_{01}(t),\ldots,h_{0K}(t)\) are left unspecified. They can differ in level and shape. The common coefficient vector \(\\beta\) describes the effects of the variables that remain in the model.

Interpretation: Stratification is useful when a factor is important for controlling baseline heterogeneity but you do not need a single proportional-hazards estimate for that factor itself.

The Stratified Cox Model

Let \(S_i\) denote the stratum for subject \(i\). The model can be written:

\[ h_i(t)=h_{0,S_i}(t)\exp(X_i\beta) \]

For three strata, for example, the model contains three unspecified baseline hazards:

\[ h_{01}(t),\qquad h_{02}(t),\qquad h_{03}(t) \]

but one common regression vector. This is the central distinction between a stratified model and fitting separate Cox models in every stratum.

Component Standard Cox Stratified Cox
Baseline hazard One common \(h_0(t)\) One \(h_{0k}(t)\) per stratum
Regression coefficients Common Common across strata
Stratification variable Can receive an HR if modeled No ordinary regression coefficient
Baseline-hazard shape Common May differ by stratum
Risk-set comparisons Across the overall eligible risk set Within each stratum

How Stratification Changes the Risk Sets

The easiest way to understand stratification is through the Cox partial likelihood. At each event time, a subject who experiences the event is compared with subjects who are still at risk.

In the stratified model, these comparisons are made within the same stratum. If a patient in stratum 2 has an event at time \(t\), the relevant risk set contains eligible patients in stratum 2 rather than patients from all strata.

1
Define the strata: use a prespecified factor such as region, center, or disease stage.
2
Create stratum-specific risk sets: each event is compared with subjects at risk in the same stratum.
3
Estimate common coefficients: information from all strata contributes to the common regression estimates.
4
Retain separate baselines: every stratum has its own unspecified baseline hazard.

The Stratified Partial Likelihood

For stratum \(k\), let \(D_k\) be its observed event times and \(R_k(t)\) its risk set at time \(t\). Ignoring tied-event complications, the partial-likelihood contribution is:

\[ L_k(\beta)= \prod_{t\in D_k} \frac{\exp(X_{i(t)}\beta)} {\sum_{j\in R_k(t)}\exp(X_j\beta)} \]

The overall stratified partial likelihood is:

\[ L(\beta)=\prod_{k=1}^{K}L_k(\beta) \]

Thus the baseline hazards disappear from the likelihood used to estimate \(\\beta\), while stratification remains visible through the separate risk sets. This is why the model can accommodate very different baseline hazard shapes without requiring a parametric baseline model.

When Should You Use Stratification?

1. Strong baseline heterogeneity

Center, region, disease stage, or another design-defined factor may generate large differences in baseline risk. If the factor is primarily a nuisance adjustment variable, stratification is often attractive.

2. A questionable PH assumption for the factor

If a categorical factor does not satisfy proportional hazards, stratification removes the need to estimate one constant hazard ratio for that factor. The factor instead defines separate baseline hazards.

3. A prespecified randomization factor

If randomization was stratified by region or another prognostic factor, the SAP may specify that factor as a Cox stratification variable. This preserves adjustment for the design feature without requiring a proportional-hazards coefficient for it.

4. Adjustment without scientific interest in the factor

If the scientific question concerns treatment, age, biomarker status, or another variable—not the stratum itself—stratification can provide flexible nuisance adjustment.

When Should You Not Stratify?

  • You need an HR for the factor. Stratification does not produce an ordinary HR for the stratification variable.
  • There are many sparse strata. Very small risk sets and few events can reduce precision.
  • Treatment effects differ across strata. A standard stratified model still assumes a common treatment coefficient.
  • The variable is post-baseline. Baseline stratification should not be confused with time-dependent modeling.
  • There is little within-stratum treatment variation. A stratum containing only one treatment group cannot provide the usual within-stratum treatment contrast.
Rule of thumb: Stratify when you want to control for a variable's effect on the baseline hazard but do not need to estimate a single proportional hazard ratio for that variable. If the scientific question is whether treatment effects differ by group, model that heterogeneity explicitly.

Stratification vs. Including a Covariate

Suppose \(Z\) is a three-level disease-stage variable. An ordinary Cox model could be written:

\[ h(t\mid X,Z)=h_0(t)\exp(X\beta+\gamma_Z) \]

The coefficients in \(\\gamma_Z\) provide hazard ratios for the stages relative to a reference category. The model also assumes those effects are proportional over time.

A stratified model instead uses:

\[ h_k(t\mid X)=h_{0k}(t)\exp(X\beta) \]

The second model is more flexible about the baseline hazard but does not estimate a single stage hazard ratio.

Question Covariate Stratification
Need an HR for the factor? Yes No
Want arbitrary baseline hazards by group? No Yes
Concerned about PH for the factor? Potential issue Often useful
Need treatment-by-group effects? Use interaction Interaction still needed

Worked Clinical-Trial Example

Consider a randomized oncology trial comparing an experimental treatment with control. The primary endpoint is progression-free survival. Patients come from three geographic regions. Region is prognostic, but the scientific objective is the treatment effect.

VariableRole
TIMETime to progression/death or censoring
EVENT1 = event, 0 = censored
TRT1 = experimental, 0 = control
AGEBaseline age
ECOGBaseline performance status
REGIONRegion 1, 2, or 3; stratification factor

The planned model is:

\[ h_k(t)=h_{0k}(t) \exp\left( \beta_{trt}TRT+\beta_{age}AGE+\beta_{ECOG}ECOG \right) \]

REGION is not in the linear predictor. Instead, it determines which baseline hazard and risk set apply to each patient.

Illustrative Results

Suppose the fitted model produces the following hypothetical estimates:

ParameterEstimateHR95% CIP-value
Treatment0.4051.501.15–1.960.003
Age, per year0.0121.0121.004–1.0200.004
ECOG, per category0.2801.321.10–1.580.003

For treatment:

\[ HR_{trt}=\exp(0.405)\approx1.50 \]

The illustrative estimate corresponds to an approximately 50% higher instantaneous event hazard for experimental treatment versus control, conditional on the modeled covariates and within the stratified analysis structure. These numbers are hypothetical and are included only to demonstrate interpretation.

Notice what is absent: There is no REGION coefficient. That is intentional. Region is being used to permit different baseline hazards, not to estimate region-specific hazard ratios.

Common Treatment Effect Across Strata

For three strata, the model permits:

\[ h_1(t\mid X)=h_{01}(t)\exp(X\beta) \] \[ h_2(t\mid X)=h_{02}(t)\exp(X\beta) \] \[ h_3(t\mid X)=h_{03}(t)\exp(X\beta) \]

The baseline hazards can have different shapes, but the treatment coefficient is common. Consequently:

\[ \frac{h_k(t\mid TRT=1,X)} {h_k(t\mid TRT=0,X)} = \exp(\beta_{trt}) \]

for every stratum \(k\). This is why stratified baseline hazards do not automatically mean stratum-specific treatment effects.

If Treatment Effects Differ by Stratum

Suppose treatment is believed to work differently across regions. Stratification alone does not estimate three treatment effects. A treatment-by-region interaction must be introduced, or separate analyses must be justified.

\[ h_k(t)=h_{0k}(t) \exp\left( \beta_{trt}TRT+\gamma_k(TRT\times REGION_k)+X\beta \right) \]

The interaction terms allow the treatment effect to vary by stratum. This is a different scientific question from allowing baseline hazards to differ.

Keep the concepts separate: stratification addresses baseline-hazard heterogeneity; interaction addresses effect heterogeneity.

Stratification and the PH Assumption

For two subjects in the same stratum, the model implies:

\[ \frac{h_i(t)}{h_j(t)} = \exp\left((X_i-X_j)\beta\right) \]

which does not depend on time. Stratification can remove the proportional-hazards assumption for the stratification factor itself, but it does not automatically fix a PH violation for treatment, age, ECOG, or another variable that remains in the linear predictor.

Schoenfeld Residual Diagnostics

For important modeled covariates, Schoenfeld residual diagnostics can be used to assess whether there is evidence that a coefficient changes over time. If treatment violates PH, possible approaches include a time-varying treatment effect, a piecewise model, or an alternative survival model. Stratifying on an unrelated center or region variable does not resolve a treatment PH violation.

Tied Event Times

Clinical-trial event times are often tied because times are recorded to a day, week, visit, or other discrete resolution. The simple partial-likelihood expression assumes distinct event times, so software uses a method for tied events.

Common choices include the Breslow and Efron methods. The stratified structure remains the same: tied-event calculations are performed within the relevant stratum-specific risk sets.

Practical point: Document the tie method in the statistical analysis plan or analysis documentation. Efron's method is often preferred when ties are not negligible because it generally provides a more accurate approximation than the simple Breslow treatment.

SAS Implementation: PROC PHREG

In SAS, use the STRATA statement in PROC PHREG.

proc phreg data=analysis;
    class trt(ref='0') ecog(ref='0');

    model time*event(0) =
        trt
        age
        ecog
        / ties=efron
          rl;

    strata region;
run;

The STRATA REGION statement gives each region its own baseline hazard. REGION therefore does not appear as an ordinary regression parameter.

SAS: Allowing Treatment-by-Region Heterogeneity

proc phreg data=analysis;
    class trt(ref='0') ecog(ref='0') region;

    model time*event(0) =
        trt
        age
        ecog
        trt*region
        / ties=efron
          rl;

    strata region;
run;

The interaction terms answer a different question: whether the treatment effect changes across regions.

R Implementation: survival::coxph

In R, put strata(region) directly in the model formula:

library(survival)

fit <- coxph(
  Surv(time, event) ~ trt + age + ecog + strata(region),
  data = analysis,
  ties = "efron"
)

summary(fit)

The output contains coefficients for treatment, age, and ECOG but not for REGION. That is the expected behavior for a stratification factor.

Checking PH Assumptions in R

ph_test <- cox.zph(fit)

print(ph_test)
plot(ph_test)

These diagnostics concern the covariates represented by estimated coefficients. A stratified variable is not being estimated as an ordinary coefficient.

Stratification Is Not the Same as Clustering

Another common source of confusion is the distinction between stratification and correlation or clustering.

MethodPrimary purposeWhat changes?
StratificationAllow different baseline hazardsRisk sets and baseline-hazard structure
Robust sandwich varianceAccount for dependenceVariance estimation
Frailty/random effectModel unobserved heterogeneityRandom-effect structure

For example, repeated observations or correlated patients within a provider may call for a robust variance approach. That does not mean the provider should automatically be a Cox stratification factor. The two methods solve different problems.

Key distinction: Stratification changes the hazard model. A robust sandwich estimator changes the variance calculation. They are not interchangeable.

Efficiency and Sparse Strata

The flexibility of stratification has a cost. Because comparisons are made within strata, subjects in different strata do not directly enter one another's risk sets. If there are many strata with few events, the common regression estimates can become less precise.

Before stratifying, examine:

  • the number of strata;
  • subjects and events per stratum;
  • treatment balance within each stratum;
  • within-stratum variation in the important covariates; and
  • whether the factor is truly needed as a baseline-hazard adjustment.

Clinical-Trial Analysis Workflow

1
Define the estimand: specify the treatment effect the survival analysis is intended to estimate.
2
Choose adjustment variables: distinguish factors requiring an estimated effect from nuisance factors suitable for stratification.
3
Review strata: check subjects, events, and treatment balance within each stratum.
4
Fit the prespecified model: include the stratification factor using STRATA in SAS or strata() in R.
5
Check PH: assess important covariates that remain in the linear predictor.
6
Assess heterogeneity: if scientifically justified, investigate treatment-by-stratum interactions.
7
Report clearly: give the HR, CI, tie method, adjustment covariates, and stratification factor.

Common Mistakes

Mistake 1: Expecting an HR for the Stratification Variable

If STRATA REGION is specified, there is no conventional REGION hazard ratio in the model output. That is a feature, not an error.

Mistake 2: Assuming Stratification Creates Separate Treatment Effects

A standard stratified Cox model estimates a common treatment coefficient. Separate effects require an interaction or separate models.

Mistake 3: Stratifying on Treatment

Treatment is generally not an appropriate stratification variable when the primary goal is to estimate its hazard ratio. The treatment contrast must remain available for the regression comparison.

Mistake 4: Using Stratification to Hide a Treatment PH Violation

Stratifying on region does not make a time-varying treatment effect proportional. Treatment itself needs an appropriate time-dependent or alternative modeling strategy.

Mistake 5: Creating Excessive Numbers of Strata

A large number of sparse strata can fragment the risk sets and reduce precision. Center stratification can be appropriate in multicenter trials, but the number of centers and event counts should be considered.

Example SAP Language

A concise SAP description might be:

Example: The primary analysis of progression-free survival will use a Cox proportional hazards model with treatment as the primary covariate and baseline age and ECOG performance status as adjustment covariates. Region will be included as a stratification factor, allowing for region-specific baseline hazards. The treatment hazard ratio and corresponding 95% confidence interval will be estimated using the Efron method for tied event times.

The final wording should match the actual protocol, estimand, randomization scheme, endpoint definition, censoring rules, and prespecified analysis conventions.

Key Takeaways

  • A stratified Cox model permits different baseline hazard functions across strata.
  • The regression coefficients remain common across strata unless interactions are added.
  • The stratification variable does not receive a conventional hazard-ratio estimate.
  • Stratification is useful when baseline heterogeneity is important but a single proportional-hazards effect for the factor is not scientifically required.
  • Stratification can avoid the PH assumption for the stratification factor itself, but not for other modeled covariates.
  • Treatment-effect heterogeneity requires an interaction or another explicitly heterogeneous-effects approach.
  • Too many small strata can reduce the precision of the common regression estimates.
  • In SAS use STRATA; in R use strata() within coxph().
Bottom line: Stratified Cox regression means: "Estimate the covariate effects using within-stratum survival comparisons, while allowing each stratum to have its own baseline hazard." That flexibility is often especially valuable in multicenter and heterogeneous clinical-trial populations.

References

Cox, D.R. (1972). Regression Models and Life-Tables. Journal of the Royal Statistical Society: Series B, 34(2), 187–220.
Cox, D.R. (1975). Partial likelihood. Biometrika, 62(2), 269–276.
Kalbfleisch, J.D. & Prentice, R.L. (2002). The Statistical Analysis of Failure Time Data, 2nd ed. Wiley.
Klein, J.P. & Moeschberger, M.L. (2003). Survival Analysis: Techniques for Censored and Truncated Data, 2nd ed. Springer.
Therneau, T.M. & Grambsch, P.M. (2000). Modeling Survival Data: Extending the Cox Model. Springer.