Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › Stratified Cox Regression in Joint Models

Survival Models Review · Tutorial 110 of 697

Stratified Cox Regression in Joint Models

You will learn to specify and interpret a stratified Cox event model, calculate its risk-set contributions, and decide when stratification is preferable to estimating a stratum effect.

Intermediate 13 min read

What You'll Learn

  • Write a Cox model with separate baseline hazards for predefined strata and common covariate effects.
  • Construct within-stratum risk sets and calculate partial-likelihood contributions.
  • Explain why stratification does not estimate a hazard ratio between strata.
  • Compare stratification with including a stratum indicator as a model coefficient.
  • Apply stratification to a joint-model event submodel without confusing it with the full joint likelihood.
  • Identify assumptions, diagnostics, and practical limitations of the approach.

Why Stratify a Cox Model?

A Cox model can allow different groups to have very different underlying event-time patterns without requiring those patterns to follow a particular parametric form. For example, hospitals, study sites, or disease subtypes may have distinct baseline hazards. If the scientific goal is to estimate covariate effects shared across those groups, a stratified Cox model gives each group its own baseline hazard while estimating one common set of covariate coefficients.

This is different from adding group membership as an ordinary predictor. A coefficient for group membership imposes a particular relationship between group hazards: their ratio is constant over time. Stratification does not impose that restriction, but it also does not estimate a group hazard ratio. That trade-off is central to choosing the method.

Definition: Let \(s_i\in\{1,\ldots,S\}\) denote the predefined stratum for individual \(i\), and let \(Z_i(t)\) be the covariate vector in the event model. A stratified Cox model is $$ h_i(t\mid Z_i(t),s_i)=h_{0,s_i}(t)\exp\{\beta^\mathsf{T}Z_i(t)\}. $$ Each stratum \(s\) has its own unspecified baseline hazard \(h_{0,s}(t)\), while the covariate coefficient vector \(\beta\) is common across strata. The model assumes proportional hazards for the covariates within each stratum, with the same covariate effects in every stratum.

The stratum should be defined by design or by a clear scientific grouping, rather than chosen after looking for groups that give a preferred result. The strata may differ in baseline risk in any way over time. By contrast, the effects represented by \(\beta\) are constrained to be common. Conditional on the modeled covariates, censoring must be noninformative for the event process, and event times and risk sets must be recorded correctly. With delayed entry, a person belongs to a risk set only after entry and until the event or censoring time.

How the Stratified Partial Likelihood Works

For a distinct event time \(t\) in stratum \(s\), let \(R_s(t)\) be the people in that stratum who are at risk just before \(t\), and let \(i(t)\) be the person who experiences the event. Conditional on one event occurring at that time in that risk set, the model assigns the event to person \(i(t)\) with probability proportional to \(\exp\{\beta^\mathsf{T}Z_{i(t)}(t)\}\). The common factor \(h_{0,s}(t)\) cancels from this conditional probability.

$$ P\{i(t)\text{ has the event}\mid \text{one event in }R_s(t)\} = \frac{\exp\{\beta^\mathsf{T}Z_{i(t)}(t)\}} {\displaystyle\sum_{j\in R_s(t)}\exp\{\beta^\mathsf{T}Z_j(t)\}}. $$

Multiplying these contributions over event times, using only the risk set in the event's stratum, gives the stratified partial likelihood. For distinct event times it is

$$ L_{\mathrm{partial}}(\beta) = \prod_{s=1}^{S} \prod_{t\in\mathcal{D}_s} \frac{\exp\{\beta^\mathsf{T}Z_{i(t)}(t)\}} {\displaystyle\sum_{j\in R_s(t)}\exp\{\beta^\mathsf{T}Z_j(t)\}}, $$

where \(\mathcal{D}_s\) is the set of distinct event times in stratum \(s\). The factorization across strata does not mean that each stratum gets a separate \(\beta\): the same coefficient vector appears in every factor. Tied event times require a tie method, such as the Breslow or Efron approximation, applied within the relevant stratum. The risk-set form above is for distinct event times.

Justification: Over a short interval of length \(dt\), the event probability for person \(j\) in stratum \(s\) is approximately \(h_{0,s}(t)\exp\{\beta^\mathsf{T}Z_j(t)\}dt\). Conditional on exactly one event in the risk set, the probability that it is person \(i\) is the ratio of that person's event rate to the sum of the rates: $$ \frac{h_{0,s}(t)\exp\{\beta^\mathsf{T}Z_i(t)\}dt} {\sum_{j\in R_s(t)}h_{0,s}(t)\exp\{\beta^\mathsf{T}Z_j(t)\}dt} = \frac{\exp\{\beta^\mathsf{T}Z_i(t)\}} {\sum_{j\in R_s(t)}\exp\{\beta^\mathsf{T}Z_j(t)\}}. $$ Thus the stratum-specific baseline hazard cancels at each event time, while the covariate effects remain.

Worked Example: Two Risk Sets, Two Strata

Consider a hypothetical study with a binary covariate \(X\). At one event time in stratum A, the risk set contains three people: the person who has the event has \(X=1\), and the other two have \(X=0\) and \(X=1\). At one event time in stratum B, the event person has \(X=0\), and the other person at risk has \(X=1\). Calculate the partial-likelihood contributions at the candidate value \(\beta=\log(2)\).

In stratum A, \(\exp(\beta)=2\). The event person's numerator is 2, and the risk-set denominator is \(2+1+2=5\). The contribution is \(2/5=0.4000\).

In stratum B, the event person's numerator is \(\exp(0)=1\), and the denominator is \(1+2=3\). The contribution is \(1/3=0.3333\).

The combined partial likelihood at this candidate coefficient is \((2/5)(1/3)=2/15=0.1333\). This is a partial-likelihood value, not a probability that the model or coefficient is correct. The calculation illustrates that each event is compared only with people at risk in the same stratum, while the same \(\beta\) is used in both strata.

Stratification Versus a Stratum Coefficient

If stratum membership is instead entered as a predictor, a two-stratum model might be written \(h_i(t)=h_0(t)\exp\{\delta I(s_i=2)+\beta^\mathsf{T}Z_i(t)\}\). This model estimates \(\delta\), and it assumes the hazard ratio for stratum 2 versus stratum 1 is \(\exp(\delta)\) at every time, holding the other covariates fixed. Stratification replaces that assumption with separate baseline hazards \(h_{0,1}(t)\) and \(h_{0,2}(t)\). Their ratio can vary freely over time, but no single stratum coefficient is estimated.

Model choiceWhat it allowsWhat it estimates or assumes
Stratum indicator as a covariateA constant multiplicative hazard difference between groupsEstimates a stratum coefficient and its hazard ratio
Stratified Cox modelA separate, unspecified baseline hazard for each groupDoes not estimate a hazard ratio between strata; estimates common covariate effects

Worked Example: Choosing Between a Coefficient and Stratification

Suppose, hypothetically, that two predefined clinics have baseline hazards of \(0.02\) and \(0.08\) events per person-year at a particular time. A treatment has a common estimated coefficient \(\hat\beta=-0.30\). Compare the treatment interpretation under stratification with what a clinic coefficient would assert.

Under stratification, the treatment hazard ratio within either clinic is \(\exp(-0.30)=0.7408\). At the stated time, for a person with the reference treatment, the two clinic-specific hazards are \(0.02\) and \(0.08\) events per person-year. For a treated person, they are \(0.02(0.7408)=0.01482\) and \(0.08(0.7408)=0.05926\) events per person-year. The treatment comparison is common within clinics, but the baseline hazards differ.

The clinic hazard ratio at this particular time is \(0.08/0.02=4\). A clinic-indicator model would assert that this ratio is constant at every time. Stratification allows the ratio to change over time, so the value 4 is only the ratio at the stated time and is not an estimated, time-constant clinic effect. If estimating a clinic contrast is a scientific objective, stratification alone does not provide it.

Use in a Joint-Model Event Submodel

In a joint model, stratification can accommodate predefined groups with distinct baseline event patterns while retaining shared effects for the event predictors. For example, a generic event submodel may include a treatment indicator and a longitudinal marker value \(m_i(t)\), with the latter depending on the individual's longitudinal trajectory. The stratum-specific baseline handles group-level differences in baseline hazard; it does not replace the association between the longitudinal process and event risk.

$$ h_i(t\mid b_i,s_i) = h_{0,s_i}(t) \exp\{\gamma A_i+\alpha m_i(t;b_i)\}. $$

Here \(A_i\) is a treatment indicator, \(b_i\) denotes any subject-specific quantities used to define the longitudinal trajectory, and \(\gamma\) and \(\alpha\) are common across strata. The exact joint-model likelihood must also account for the longitudinal data and subject-specific quantities. The stratified Cox partial likelihood above explains the risk-set comparison conditional on the event-model predictors; it is not, by itself, the full likelihood for a joint model with latent subject-specific trajectories.

Worked Example: Interpreting a Stratified Joint-Model Event Submodel

Consider a hypothetical joint-model event submodel stratified by clinic. Let the treatment coefficient be \(\hat\gamma=-0.30\) for a treated-versus-untreated comparison, and let the marker association be \(\hat\alpha=0.25\) per marker unit. Interpret the treatment and marker contrasts for two people in the same clinic, holding other modeled quantities fixed.

For treatment, the conditional hazard ratio is \(\exp(-0.30)=0.7408\). Thus, at the same marker value and within the same clinic, the treated person's modeled hazard is about \(0.741\) times the untreated person's hazard, or about 25.9% lower. This is an association specified by the model, not evidence by itself that treatment causes lower hazard.

For a two-unit higher marker value, the modeled hazard ratio is \(\exp\{0.25(2)\}=\exp(0.50)=1.649\), conditional on treatment and clinic. The units are marker units in the two-unit contrast; the hazard ratio itself is unitless. Both comparisons are within a clinic because its baseline hazard cancels. These coefficients are assumed common across clinics; the model does not estimate a clinic hazard ratio.

Assumptions, Diagnostics, and Limitations

Stratification is most useful when the groups are known in advance, baseline hazards may differ substantially or nonproportionally, and the main effects of interest can reasonably be shared across groups. Check that the covariate proportional-hazards assumption is plausible within strata; stratification does not repair nonproportionality of a covariate effect. Schoenfeld-residual diagnostics can be used for modeled covariates, while plots of estimated stratum-specific survival or baseline hazards can reveal how the groups differ. Those plots describe baseline patterns; they do not produce a single hazard ratio between strata.

Also inspect event counts and covariate variation within each stratum. A stratum with few events contributes little information, and a covariate that has no useful variation in the relevant risk sets may have a poorly determined common effect. Creating many small strata can therefore reduce precision. Stratification is not a remedy for incorrect event times, misclassified strata, informative censoring, or a covariate effect that truly differs across strata.

A common mistake is to interpret a stratified model as estimating “the hazard ratio for clinic B versus clinic A,” perhaps by comparing their fitted baseline hazards at one time. The correction is that the model allows those baseline hazards to vary separately and does not estimate a constant clinic coefficient. If the between-clinic contrast is a target, consider a model that explicitly estimates it, while recognizing that this imposes assumptions about how the hazards relate over time. If the aim is instead to avoid imposing that relationship and estimate shared covariate effects, stratification is often preferable.

1
Define strata before fitting.
Specify the group variable and confirm that its categories are meaningful and correctly recorded.
2
State the shared-effects assumption.
Identify which event-model covariate effects are constrained to be common across strata.
3
Build stratum-specific risk sets.
At each event time, compare the event person only with people at risk in that same stratum.
4
Interpret only supported contrasts.
Report common covariate effects; do not report an estimated stratum hazard ratio unless a separate model estimates one.

Check Your Understanding

Try each question, then compare your reasoning with the solutions below.

  1. In a stratified Cox model, what is shared across strata and what is allowed to differ?
  2. A covariate has coefficient \(\hat\beta=0.20\). What is its hazard ratio for a one-unit increase, and how should the effect be described?
  3. At one time, two stratum-specific baseline hazards are \(0.03\) and \(0.06\) events per person-year. Does their ratio of 2 imply that the fitted stratified model estimates a constant stratum hazard ratio of 2?
  4. Why might a researcher stratify by study site rather than include site as a predictor?

Solutions. (1) The covariate coefficient vector is shared; each stratum has its own unspecified baseline hazard. (2) \(\exp(0.20)=1.221\). A one-unit increase is associated with a 1.221-fold hazard, or about 22.1% higher hazard, conditional on the other modeled predictors and within a stratum. (3) No. The ratio is 2 at the stated time only; stratification does not estimate a constant site hazard ratio. (4) Stratification is appropriate when site-specific baseline hazards may differ in shape over time and the researcher wants shared covariate effects without imposing a constant site hazard ratio.

Clinical Biostats