Statistics & Analysis
Log Rank Test
Definition
The log rank test is a nonparametric statistical test used in survival analysis to compare the time to event distributions between two or more groups. It tests the null hypothesis that the survival curves are identical across groups by comparing the observed number of events in each group to the number expected under the null hypothesis at each event time.
Why it matters
The log rank test is the most widely used method for comparing survival curves in clinical trials and epidemiological studies. It is the standard companion to the Kaplan Meier estimator: after estimating and plotting survival curves for each group, the log rank test provides a formal statistical assessment of whether the observed differences are likely to reflect true differences in survival or could have arisen by chance. It is the usual test for comparing arms in trials with a time to event primary endpoint, and its p value often determines whether a treatment is considered to have a statistically significant effect on survival.
How it works
The log rank test operates by comparing the observed and expected numbers of events at each time point where an event occurs. At each event time, the number of events in each group is compared to the number expected under the assumption that the survival distributions are identical. The expected number of events in a group is calculated as the product of the total number of events at that time and the proportion of the total number at risk that belongs to that group.
The test statistic is the sum of the differences between observed and expected events across all event times in one group, squared and divided by the variance. Under the null hypothesis, this statistic follows a chi squared distribution with k minus 1 degrees of freedom, where k is the number of groups. A significant p value indicates that the survival distributions differ, but it does not quantify the magnitude of the difference; the hazard ratio (from a Cox model) provides that information.
The log rank test gives equal weight to all time points, which makes it most powerful when the hazard ratio is approximately constant over time (proportional hazards). When hazard ratios vary over time (for example, when one treatment shows early benefit but the curves converge later, or when curves cross), the log rank test may have reduced power. In such cases, alternatives such as the Wilcoxon (Breslow) test (which gives more weight to early events), the Fleming Harrington family of tests (which can be tuned to weight specific time periods), or the restricted mean survival time (RMST) difference may be more appropriate.
Stratified log rank tests can account for important prognostic factors (such as disease stage or treatment center) by performing the test within strata and combining the results. This is analogous to stratified randomization and helps ensure that the comparison is fair when important baseline differences exist.
When to use it
Use the log rank test when comparing the survival (time to event) experience of two or more groups and when the proportional hazards assumption is plausible. It is standard for comparing treatment arms in clinical trials with time to event primary endpoints. For comparisons involving more than two groups, it can test the overall null hypothesis, followed by pairwise comparisons with appropriate multiple testing corrections. Use alternative tests when hazard ratios are not constant over time or when early or late events are of particular clinical interest.
Key takeaways
- The log rank test is the most widely used method for comparing survival curves in clinical trials and epidemiological studies.
- At each event time, the number of events in each group is compared to the number expected under the assumption that the survival distributions are identical.
- Use the log rank test when comparing the survival (time to event) experience of two or more groups and when the proportional hazards assumption is plausible.
- A common error is using the log rank test when survival curves cross, which violates the proportional hazards assumption and can result in a nonsignificant p value even when the treatments have meaningfully different survival patterns.
Common mistakes
A common error is using the log rank test when survival curves cross, which violates the proportional hazards assumption and can result in a nonsignificant p value even when the treatments have meaningfully different survival patterns. Another mistake is interpreting a nonsignificant log rank test as evidence of no treatment difference, when the study may have been underpowered to detect a clinically important difference. Some researchers report only the log rank p value without also reporting hazard ratios and confidence intervals, which provide essential information about the magnitude and precision of the treatment effect. Finally, failing to stratify the log rank test for important prognostic variables that differ between groups can lead to misleading comparisons.
Example
A randomized trial compares surgical resection followed by adjuvant chemotherapy versus chemotherapy alone in 400 patients with advanced pancreatic cancer. The Kaplan Meier median survival is 14.2 months in the surgery group and 11.8 months in the chemotherapy only group. The log rank test yields chi squared = 5.92, df = 1, p = 0.015, indicating a statistically significant difference in survival. The Cox proportional hazards model estimates a hazard ratio of 0.73 (95% CI: 0.57 to 0.94), indicating a 27% lower rate (hazard) of death at any given time in the surgery group. A Schoenfeld residual test shows no evidence that the proportional hazards assumption is violated (p = 0.41).
Sources
- [1]Hopewell S, Chan AW, Collins GS, Hróbjartsson A, Moher D, Schulz KF, et al. CONSORT 2025 statement: updated guideline for reporting randomised trials. BMJ. 2025;389:e081123.
- [2]Bland JM, Altman DG. The logrank test. BMJ. 2004;328(7447):1073.
- [3]Peto R, Peto J. Asymptotically efficient rank invariant test procedures. J R Stat Soc Ser A. 1972;135(2):185-207.
- [4]Royston P, Parmar MKB. Restricted mean survival time: an alternative to the hazard ratio for the design and analysis of randomized trials with a time-to-event outcome. BMC Med Res Methodol. 2013;13:152.
Cite this term
Log Rank Test. Paperguide Research Glossary. Paperguide, 2026. Available at: https://paperguide.ai/research-glossary/log-rank-test/(Paperguide, 2026)