Skip to content
Scintria
ToolsGrant writerFunding
HomeLiteratureClinical trialsEvidence LabProtocol packData analysisLearnProjectsLibraryReferencesApplications
Start free
ScintriaStart free

Learn / Biostatistics / Survival analysis

Comparing survival curves: the log-rank test and hazard ratios

14 minute read · 6-question quiz

Download this lesson as a colour Word or PDF study guide with the figures and answers. Included in paid plans; reading and quizzes stay free.Sign in

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\
00.250.50.75105101520Months since randomisationEvent-free survivalNew regimen: 7 eventsControl: 10 events
Kaplan-Meier curves for two arms. The new regimen's curve stays above the control curve; median 14 months versus 7 months.

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.

StudyEstimate (95% CI)New regimen vs control0.5 (0.19–1.33)0.20.250.51Hazard ratio (log scale); below 1 favours the new regimen
The point estimate suggests benefit, but the wide interval crossing 1 means the small trial is inconclusive.

HR is not the same as RR or the difference in medians

A hazard ratio of 0.50 does not mean 'half the people die' or 'survive twice as long'. It is a ratio of instantaneous event rates averaged over follow-up. Always supplement it with absolute measures: survival at 12 months in each arm, difference in median or restricted mean survival time, and the number needed to treat at a stated time.

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.

Competing risks

In a study of time to HIV-related death, deaths from road accidents or other causes prevent the event of interest from happening. Treating them as ordinary censoring overstates the probability of HIV death. Use cumulative incidence functions and Fine-Gray or cause-specific hazard models when competing events are common.

Reporting checklist

KM plot with numbers at risk; events per arm; median follow-up; HR with 95% CI; log-rank p-value; survival at a clinically useful time in each arm; check of proportional hazards.

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

Question 1
1

An HR of 0.70 for death with treatment means:

Question 2
2

The log-rank test mostly tests whether:

Question 3
3

Crossing Kaplan-Meier curves suggest:

Question 4
4

A HR of 0.60 (95% CI 0.30 to 1.20) is best described as:

Question 5
5

Comparing survival from time zero between 'responders' and 'non-responders' to treatment creates:

Question 6
6

When deaths from other causes prevent the event of interest, the appropriate framework is:

Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.

Time-to-event data, censoring and the Kaplan-Meier curveThe Cox proportional hazards model