BanglayShikhi
← ⏳ Survival Analysis

Log-rank test

5 min

The log-rank test compares the survival curves of two or more groups.

Why it matters

It tells whether differences between curves are larger than chance would give.

Key ideas

  • H0: the groups have the same survival over time
  • Compares observed and expected events at each event time
  • Result: χ², df = groups − 1, p
  • Works best if the curves do not cross
  • Does not give the size of the difference (use Cox for HR)
  • Needs independent groups

Real-life research example

Does survival differ between treatment A and B? A log-rank test gives p = 0.02.

When to use

  • Compare survival curves between groups

When NOT to use

  • Don't use when curves clearly cross
  • Don't report only p without showing the curves

Mini example

Group A: 4 deaths observed, 6.2 expected; Group B: 8 observed, 5.8 expected

Quick takeaway

Log-rank asks: are the curves the same?

Try it yourself

Use the Kaplan–Meier tool with a group variable. Compare the two curves and read the log-rank p-value.