Learn / Biostatistics / Survival analysis
The Cox proportional hazards model
14 minute read · 6-question quiz
What you will learn
Interpret a Cox regression table of hazard ratios
State and check the proportional hazards assumption
Adjust for covariates and understand time-varying effects
The log-rank test gives a p-value and cannot adjust for age, sex or disease stage. The Cox proportional hazards model (Sir David Cox, 1972) is the regression model for survival data. It models the hazard at time t as
h(t | X) = h_0(t) × exp(β_1 X_1 + β_2 X_2 + …)
h_0(t), the baseline hazard, is the hazard when all X are zero. Its shape over time is left unspecified; this is what makes the model 'semi-parametric' and flexible.exp(β_j)is the hazard ratio for a one-unit increase inX_j, holding the others constant.- The model assumes the HR is constant over time (proportional hazards).
Checking proportional hazards
If the effect of a variable changes over time (for example, a surgical treatment has high early risk but long-term benefit), a single HR is wrong. Check by:
- Plotting log(-log(survival)) against log(time) for each group. Roughly parallel lines support proportionality.
- Schoenfeld residuals: a test of correlation between scaled residuals and time. A significant result flags non-proportionality.
- Eyeballing the KM curves: crossing curves are an obvious red flag.
If violated: stratify by the offending variable (separate baseline hazards for each stratum), include a variable-by-time interaction (a time-varying coefficient), split follow-up into periods and report a HR for each, or use restricted mean survival time.
Practical rules
- Events, not participants, matter. Aim for at least 10 events per covariate (like logistic regression). 180 deaths would allow around 18 covariates; 20 deaths allows only 2.
- Ties (several events at the same time) are handled by the Efron method in modern software.
- Time scale and time zero: define a clear time zero (randomisation, not enrolment) and avoid beginning follow-up at a different point for different groups.
- Time-varying covariates (e.g., current CD4) are allowed in extended Cox models, but those variables must be treated with care so as not to adjust away the effect of treatment.
- Clustered data: if people come from the same site or household, use robust SEs or a frailty (random effect) model.
- Prediction: a Cox model gives relative effects. To predict absolute risk at a time you also need the baseline survival.
Summary
Cox regression gives hazard ratios adjusted for covariates without specifying the baseline hazard.
Hazard ratios multiply across covariates and are assumed constant over time.
Check proportional hazards with log-log plots, Schoenfeld residuals and the KM plot.
Aim for about 10 events per covariate.
Report absolute survival alongside HRs.
Check your understanding
Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.