Tutorials › Joint Modeling of Longitudinal and Time-to-Event Data › The Cox Proportional Hazards Model in Joint Models

Survival Models Review · Tutorial 103 of 697

The Cox Proportional Hazards Model in Joint Models

Specify a Cox proportional hazards model, assess what its assumptions mean, and calculate hazard ratios for realistic covariate contrasts.

Intermediate 10 min read

What You'll Learn

  • Write the Cox hazard as a baseline hazard multiplied by an exponential covariate effect.
  • Distinguish proportional hazards from constant hazards over time.
  • Calculate a hazard ratio for a one-unit or multi-unit covariate contrast.
  • Interpret hazard ratios conditionally, with clear units and appropriate limits.
  • Identify assumptions, diagnostic clues, and alternatives to the Cox model.

Why Use a Cox Model?

A survival analysis often needs to relate event timing to predictors while allowing the underlying event rate to change over time in a complicated way. For example, the event rate after diagnosis might rise, fall, or vary irregularly as time since diagnosis increases. A model that requires this baseline pattern to follow a specific distribution can be restrictive. The Cox proportional hazards model instead leaves the baseline hazard unspecified while modeling how covariates multiply it.

This model is useful in joint modeling because an event submodel can express how included predictors relate to the event hazard. Those predictors may include ordinary baseline covariates, and in a joint analysis may involve quantities from a longitudinal process. The Cox form specifies the survival-model component; by itself, it does not explain how longitudinal measurements are modeled or linked to the event process.

Definition: Let \(T_i\) be the event time for subject \(i\), and let \(\mathbf{z}_i=(z_{i1},\ldots,z_{ip})^\top\) be that subject's covariate vector. The Cox proportional hazards model specifies the hazard as $$ h_i(t\mid \mathbf{z}_i)=h_0(t)\exp(\mathbf{z}_i^\top\boldsymbol{\beta}), $$ where \(h_0(t)\) is an unspecified, nonnegative baseline hazard and \(\boldsymbol{\beta}=(\beta_1,\ldots,\beta_p)^\top\) is a vector of regression coefficients. The baseline hazard is the hazard for the reference covariate vector \(\mathbf{z}_i=\mathbf{0}\).

The hazard has units of inverse time: if time is measured in months, the hazard is expressed per month. The exponential term is dimensionless and positive. Consequently, covariates multiply the baseline hazard rather than add to it. There is no separate intercept in this expression; a constant multiplier can be absorbed into \(h_0(t)\).

What Proportional Hazards Means

The defining assumption is that covariates change the hazard by a constant multiplicative factor over time. For two covariate vectors \(\mathbf{z}_a\) and \(\mathbf{z}_b\), their hazard ratio at time \(t\) is

$$ \frac{h(t\mid \mathbf{z}_a)}{h(t\mid \mathbf{z}_b)} = \frac{h_0(t)\exp(\mathbf{z}_a^\top\boldsymbol{\beta})} {h_0(t)\exp(\mathbf{z}_b^\top\boldsymbol{\beta})} = \exp\big((\mathbf{z}_a-\mathbf{z}_b)^\top\boldsymbol{\beta}\big). $$

The baseline hazard cancels, so this ratio does not depend on \(t\). That constancy—not a constant hazard—is the proportional-hazards assumption. The baseline hazard can vary with time in any nonnegative pattern. The model does assume that the covariate effects represented by the coefficients do not change over time.

For a one-unit increase in covariate \(z_j\), holding the other covariates fixed, the model-implied hazard ratio is \(\exp(\beta_j)\). For a change of \(d\) units, it is \(\exp(d\beta_j)\). This is a relative comparison of instantaneous event rates among subjects still at risk at time \(t\), conditional on the covariates in the model. It is not a ratio of event probabilities or a difference in survival probabilities.

1
Write the two hazards.
For the two covariate profiles, use \(h_0(t)\exp(\mathbf{z}_a^\top\boldsymbol{\beta})\) and \(h_0(t)\exp(\mathbf{z}_b^\top\boldsymbol{\beta})\).
2
Form their ratio.
The common baseline hazard divides out, leaving \(\exp(\mathbf{z}_a^\top\boldsymbol{\beta}-\mathbf{z}_b^\top\boldsymbol{\beta})\).
3
Interpret the contrast.
The hazard ratio depends on the covariate difference and the fitted coefficients, not on time. This conclusion requires the specified proportional-hazards model to be adequate.

Worked Hazard-Ratio Calculations

Worked Example: A Binary Treatment Indicator

Hypothetical data and fitted model. Suppose a study records time to an event in months and uses \(z=1\) for treatment and \(z=0\) for control. A Cox model gives a fitted treatment coefficient \(\hat{\beta}=-0.40\). At month 6, suppose the fitted baseline hazard is \(0.0800\) events per person-month. Calculate and interpret the treatment-versus-control hazard ratio and the two model-implied hazards at that time.

Hazard ratio. The treatment-control covariate difference is \(1-0=1\), so \(HR=\exp(1\times -0.40)=\exp(-0.40)\approx 0.6703\). The fitted hazard for the treatment group is about 0.6703 times the control hazard at any given time, under the model.

Hazards at month 6. For control, \(h(6\mid z=0)=0.0800\exp(0)=0.0800\) events per person-month. For treatment, \(h(6\mid z=1)=0.0800\exp(-0.40)\approx 0.0800(0.6703)=0.05362\) events per person-month. Their ratio is \(0.05362/0.0800\approx0.6703\), agreeing with the coefficient calculation.

This is a comparison of instantaneous hazards at month 6, not a claim that treatment reduces each person's probability of an event by 32.97 percentage points or that the treatment causes an outcome change.

Worked Example: A Continuous Biomarker Covariate

Hypothetical data and fitted model. Consider a baseline biomarker measured in mg/L, with fitted coefficient \(\hat{\beta}=0.12\) per mg/L. Suppose the fitted baseline hazard at a particular time is \(0.0200\) per year. Calculate the hazard ratio for a 2 mg/L increase, and the corresponding hazards at biomarker values of 4 and 6 mg/L.

Contrast calculation. For a 2 mg/L increase, the hazard ratio is \(\exp(2\times0.12)=\exp(0.24)\approx1.271\). Thus, for subjects identical on other modeled covariates, the model estimates a hazard about 1.271 times as large at 6 mg/L as at 4 mg/L.

Hazards at the specified time. At 4 mg/L, \(h(t\mid z=4)=0.0200\exp(0.12\times4)=0.0200\exp(0.48)\approx0.03232\) per year. At 6 mg/L, \(h(t\mid z=6)=0.0200\exp(0.12\times6)=0.0200\exp(0.72)\approx0.04109\) per year. The ratio is approximately \(0.04109/0.03232=1.271\), subject to rounding.

The units matter: the coefficient is per mg/L, while the hazard ratio for a chosen contrast is dimensionless. Because a 2 mg/L contrast was used, the relevant calculation is \(\exp(2\hat{\beta})\), not simply \(\exp(\hat{\beta})\).

Worked Example: Combining Two Covariate Differences

Hypothetical fitted model. Suppose a model includes a treatment indicator \(z_{\mathrm{trt}}\) and age \(z_{\mathrm{age}}\) in years, with fitted coefficients \(\hat{\beta}_{\mathrm{trt}}=-0.30\) and \(\hat{\beta}_{\mathrm{age}}=0.02\) per year. Compare a treated subject who is 10 years older with a control subject, holding all other covariates equal.

The linear-predictor difference is \((-0.30)(1-0)+(0.02)(10)= -0.30+0.20=-0.10\). Therefore the hazard ratio is \(\exp(-0.10)\approx0.9048\). Equivalently, the two contributions multiply: \(\exp(-0.30)\approx0.7408\), \(\exp(0.20)\approx1.2214\), and \(0.7408\times1.2214\approx0.9048\).

Under this fitted model, the combined profile has an estimated hazard about 0.9048 times the comparison profile's hazard at any fixed time. It would be incorrect to report the treatment hazard ratio alone, because age also differs between these profiles. The interpretation is conditional on the model and is not, by itself, causal.

Assumptions, Diagnostics, and Failure Modes

The Cox specification is useful only if its assumptions are plausible for the analysis. In addition to proportional hazards, the covariate model must be adequately specified. For example, if a continuous covariate has a nonlinear relationship with the log hazard, forcing a straight-line term \(\beta z\) can misrepresent that relationship. The event and censoring records must also support valid inference: censoring is generally assumed to be independent of the event time conditional on modeled covariates, and observations from different subjects are treated as independent unless their dependence is handled appropriately.

A fitted hazard ratio should be checked against both the structure of the data and the model's assumptions. For a categorical predictor, plots of estimated log cumulative hazards can provide a qualitative check: substantial nonparallel patterns are a warning that a constant hazard ratio may be inadequate. For continuous predictors, inspect whether the assumed functional form is reasonable rather than presuming each unit has the same effect on the log hazard. Also check for sparse covariate patterns, influential observations, and data-entry or time-scale errors. A diagnostic pattern is evidence to investigate, not a mechanical proof that an assumption holds or fails.

A major limitation is that the Cox model does not specify \(h_0(t)\) through a small set of parameters. This flexibility avoids imposing a particular baseline-hazard shape, but the Cox form alone does not give a fully specified event-time distribution. It also does not automatically solve measurement error, missing longitudinal measurements, or dependence between a longitudinal process and event times. If a longitudinal quantity enters a joint event model, its representation and interpretation require the broader joint model, not merely the Cox equation.

ApproachWhat it providesMain distinction
Cox proportional hazards modelCovariate hazard ratios with an unspecified baseline hazardFlexible baseline; assumes covariate hazard ratios are constant over time
Kaplan–Meier curves and log-rank testUnadjusted survival comparisons between groupsUseful for descriptive group comparisons, but does not provide adjusted covariate effects in the Cox form
Parametric survival modelA specified event-time distribution and baseline-hazard formCan yield a fully parametric survival model, but depends on the distributional specification

The log-rank test is appropriate for comparing survival curves in its setting, but a Cox model is often chosen when the objective is an adjusted covariate comparison. Neither method makes the proportional-hazards assumption true by itself. If hazard ratios change with time, a single Cox coefficient can obscure that pattern; the model should be reconsidered rather than interpreting its average-looking summary as a constant effect.

Common Mistakes

  • Confusing proportional hazards with constant hazards. The baseline hazard may change over time. The assumption is that the ratio of hazards between fixed covariate profiles stays constant.
  • Calling a hazard ratio a risk ratio. A hazard is an instantaneous rate among those still at risk; it is not the probability of an event over a fixed interval.
  • Using the wrong covariate contrast. For a \(d\)-unit increase, calculate \(\exp(d\hat{\beta})\). For profiles that differ on multiple covariates, include every relevant coefficient contrast.
  • Overstating an observational coefficient. A fitted hazard ratio describes a conditional association under the model. It does not establish that changing a covariate would cause the corresponding hazard change.
  • Assuming a flexible baseline guarantees a correct model. The baseline is unspecified, but proportional hazards, covariate form, and censoring assumptions still matter.
Key takeaway: In a Cox model, \(h_0(t)\) describes the baseline hazard over time, while \(\exp(\mathbf{z}^\top\boldsymbol{\beta})\) multiplies it according to covariates. For any specified contrast, exponentiate the fitted linear-predictor difference to obtain the hazard ratio, and interpret it as a conditional relative hazard—not as an event probability.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A fitted binary covariate coefficient is \(\hat{\beta}=0.25\). What is the hazard ratio for covariate value 1 versus 0, and how should it be interpreted?
  2. A continuous covariate has fitted coefficient \(-0.08\) per unit. Calculate the hazard ratio for a 3-unit increase.
  3. In a Cox model, the baseline hazard doubles between two times. Under proportional hazards, does the hazard ratio between two fixed covariate profiles also double? Explain.
  4. Two profiles differ by 1 treatment unit with coefficient \(-0.30\), and by 5 age years with coefficient \(0.02\) per year. Calculate their hazard ratio for the first profile relative to the second, assuming those are the only differences.
  5. Name one reason to prefer a Cox model to a Kaplan–Meier comparison and one assumption that still requires scrutiny.

Solutions. (1) \(HR=\exp(0.25)\approx1.284\). Under the model, the covariate-value-1 group has an estimated hazard 1.284 times that of the value-0 group at a given time, conditional on other covariates. (2) \(HR=\exp(3\times-0.08)=\exp(-0.24)\approx0.7866\). (3) No. The baseline hazard cancels in the ratio, so the ratio remains constant across time under the model, even if both hazards change. (4) The linear-predictor difference is \(-0.30+5(0.02)=-0.20\), so \(HR=\exp(-0.20)\approx0.8187\). (5) Cox regression can provide covariate-adjusted hazard ratios, whereas Kaplan–Meier curves give group survival estimates and the log-rank test compares groups without that adjusted Cox specification. Proportional hazards, covariate form, and conditional independent censoring are examples of assumptions to examine.

Clinical Biostats