log-rank-test · shipping · also Logrank test, Mantel log-rank test

Log-rank test

The log-rank test compares survival distributions by accumulating observed-minus-expected events over event-time risk sets.

Related Observatory article: Read on hesela.com

For two groups, the null hypothesis is equality of their survival distributions. At each event time, expected events in group A equal total events times A's share of the risk set. Sum observed minus expected events and divide by its estimated standard deviation to obtain Z. [1]

Tied events use a hypergeometric variance. Z squared has an asymptotic chi-square reference distribution with one degree of freedom under the null; SciPy returns signed Z instead. A zero total variance leaves this standardized comparison undefined. [1] [4]

The ordinary comparison assumes independent units and non-informative right censoring within groups. Use a common event definition and time origin; repeated telemetry rows are not independent drives. Different censoring rates alone do not imply informative censoring. [2]

Crossing effects can cancel in the accumulated score, reducing power. Proportional hazards is not a universal requirement for asymptotic null validity, and a large p-value does not establish equal reliability. A test result is not an effect-size estimate. [2]

An unstratified comparison does not adjust for fleet composition or workload and does not establish causation. Stratification specifies a different comparison; complex covariate questions need an appropriate model. [3]

Relations

related
P-value, Kaplan-Meier estimator, Risk set, Informative censoring

Citations

  1. SciPy 1.16.1: logrank, null hypothesis, tied-event variance and signed statistic (accessed 2026-11-19)
  2. Uno et al. (2015): A versatile test for equality of two survival functions based on weighted differences of Kaplan-Meier curves (accessed 2026-11-19)
  3. R survival: survdiff, ordinary log-rank and stratified comparisons (accessed 2026-11-19)
  4. R survival: survdiff2.c at 0605821347ef, tied observations and the one-unit variance boundary (accessed 2026-11-19)

JSON: /data/terms/log-rank-test.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Log-rank test. Hesela. 2026-11-19. https://hesela.dev/terms/log-rank-test/