Learn / Biostatistics / Survival analysis
Comparing survival curves: the log-rank test and hazard ratios
14 minute read · 6-question quiz
What you will learn
Compare two survival curves with the log-rank test
Define the hazard and the hazard ratio, and read one in a trial report
Distinguish hazard ratios, risk ratios and differences in median survival
Now compare two treatment arms. Twelve patients on a new regimen and twelve on control are followed for up to 24 months. Time-to-failure data (months; \* = censored):
- New regimen: 3, 5, 6, 8, 10, 12\, 14, 17, 20\, 24\, 24\, 24\*
- Control: 2, 3, 4, 5, 6, 7, 9, 11, 13, 15\, 18, 22\
The curves separate. Medians are 14 months (new) and 7 months (control). But is this convincing, with so few patients?
The log-rank test
The log-rank test compares the whole survival experience of the groups. At every time an event occurs, it calculates how many events would be expected in each group if survival were the same (proportional to the numbers at risk), then adds up observed minus expected over all event times.
- H0: the survival curves are identical.
- Test statistic is approximately chi-square with (groups − 1) df.
Result for this trial: the new regimen group had 7 observed deaths against 9.9 expected under H0. The log-rank chi-square is 2.04 on 1 df, p = 0.15. Not significant: with only 17 events in total, the trial had little power. A non-significant log-rank test is not proof that the regimen fails, only that this small dataset cannot tell.
Hazards and the hazard ratio
The hazard h(t) is the instantaneous rate at which events occur at time t among those still event-free: roughly, 'the risk of the event in the next short moment, given you have survived until now'. The hazard ratio (HR) compares hazards between groups:
- HR = 1: no difference. HR = 0.5: at any moment the intervention group has half the event rate. HR = 2: twice the rate.
- The HR is estimated from a Cox proportional hazards model (next lesson), which assumes the ratio is constant over time.
For our data, the Cox model gives HR = 0.50, 95% CI 0.19 to 1.33, p = 0.17: half the hazard, but compatible with anything from an 81% reduction to a 33% increase.
Practical points
- Log-rank vs Wilcoxon-type tests: the log-rank is most powerful when hazards are proportional; Gehan-Breslow or Fleming-Harrington versions weight early or late differences.
- Stratified log-rank: compares within strata (site, sex) and combines, useful when randomisation was stratified.
- Crossing curves violate proportional hazards: a single HR then gives a misleading summary. Describe the pattern, use restricted mean survival time or landmark analyses.
- Immortal-time bias: do not define groups by something that occurs after time zero (e.g. 'responders') and then compare survival from time zero; responders have had to survive to be classified.
Summary
The log-rank test compares survival curves overall; it needs enough events to have power.
The hazard ratio is the ratio of instantaneous event rates, estimated by Cox regression.
A small trial with HR 0.5 and CI 0.19 to 1.33 is inconclusive, not negative.
Report absolute survival and medians alongside the HR.
Crossing curves, immortal-time bias and competing risks need special care.
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.