- Introduced by
- Mantel, N.
- Year
- 1966
- Type
- Non-parametric hypothesis test
What does it do?
The log-rank test, introduced by Nathan Mantel in 1966, is a non-parametric hypothesis test that compares the survival experience of two or more groups over the whole follow-up period.
It is the usual companion to Kaplan-Meier curves: it tests whether the differences between those curves are larger than chance would produce. Its output is a chi-square statistic and p-value rather than an estimate of effect size.
The intuition behind the method
When you plot Kaplan-Meier survival curves for two groups, such as treated and control, you want to know whether the visual separation between them is more than chance. The log-rank test checks, at each time where an event occurs, whether each group experienced more or fewer events than would be expected if the groups had identical survival. The accumulated discrepancy across all event times is converted into a single chi-square statistic.
History
Nathan Mantel introduced the test in 1966 in a paper on evaluating survival data, proposing two new rank-order statistics for survival data. The paper appeared in Cancer Chemotherapy Reports. The test is also known as the Mantel-Cox test. It is now widely used for comparing Kaplan-Meier curves in clinical and epidemiological research.
When to use it
Choose the log-rank test to compare the overall survival distributions of two or more independent groups when the data are right-censored time-to-event data and the question is whether the curves differ at all, not how large the difference is. It fits best when hazards are approximately proportional. Kaplan-Meier curves that cross are a warning that proportionality may fail, but curves that do not cross do not by themselves confirm it; a log-log plot or a formal test of the assumption is needed before relying on the result. Censoring should be non-informative, so that censored subjects carry the same future risk as those still under observation. Do not rely on it alone when you need an adjusted comparison or a hazard ratio, when curves cross, or when the group difference clearly changes over time; in those situations use Cox regression, a stratified test, or a method designed for time-varying effects. Avoid it when event counts are very sparse in any group.
Limitations and considerations
- Its power is highest when hazards are proportional. When the hazard ratio changes over time, as with crossing curves, the test can miss differences that a differently weighted comparison would detect.
- It gives a test statistic and p-value but no effect size; a hazard ratio with a confidence interval requires a separate model such as Cox regression.
- It is an unadjusted comparison. Baseline imbalances between groups cannot be removed unless stratification or a regression model is used.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Makes no parametric assumption about the shape of the survival distribution; it uses only the ordering of the event times in the data.
- Uses right-censored observations properly: a subject censored before an event still counts in the at-risk sets at earlier event times, so no information is discarded.
- Compares the full curves over follow-up, so it does not require choosing a single time point in advance.
Applications
- Clinical trials comparing patient survival or time to relapse between treatment arms.
- Epidemiological cohort studies examining time to a disease event across exposure groups.
- Reliability engineering studies comparing the time to failure of components under different conditions.
- Social science research on time to employment, recidivism, or other life-course events across demographic groups.
How it works
How it works
At each distinct event time t_i, count the events observed in each group and the events expected for that group if all groups shared the same survival. The per-time expected count for group g is its share of the subjects still at risk just before t_i, (n_gj,i / n_i), multiplied by the total number of events d_i at that time. Summing these per-time terms over all event times gives the cumulative expected count E_gj used in the test.
Formula
E_{gj} = \sum_i \frac{n_{gj,i}}{n_i} d_iFor a comparison of two groups, let O be the observed number of events in one group at each event time and E the corresponding expected number from the expected-events step. The differences (O minus E) are summed across event times, and the square of this summed difference is divided by its variance to give a chi-square statistic with one degree of freedom. The variance is the hypergeometric variance: at each event time i, with d_i events among n_i subjects at risk, of whom n_1i and n_0i belong to the two groups, the contribution is d_i × (n_1i / n_i) × (n_0i / n_i) × (n_i − d_i) / (n_i − 1), and the total variance is the sum of these contributions over all event times. Because the contribution depends on the number of events at each time, tied event times are handled within the statistic. A large chi-square value, and therefore a small p-value, indicates that the survival distributions differ.
Formula
\chi^2 = \frac{\left(\sum_i (O_{gj,i} - E_{gj,i})\right)^2}{\mathrm{Var}\left(\sum_i (O_{gj,i} - E_{gj,i})\right)}Common pitfalls
- Interpreting the test when Kaplan-Meier curves cross. Crossing is a sign that the proportional-hazards assumption may fail, and the test result is then hard to interpret.
- Skipping the proportional-hazards check. Inspect a log-log plot of the Kaplan-Meier curves before relying on the p-value.
- Working with few events in a group. When event counts are sparse, the chi-square approximation behind the p-value is less reliable, so report the event counts alongside the result.
- Reporting the p-value alone. Pair it with a hazard ratio and confidence interval from Cox regression.
- Applying the standard test when censoring may be informative. The estimates can then be biased, and competing-risks methods should be considered.
- Reading a significant result with more than two groups as showing which groups differ. The overall test only indicates that the survival distributions are not all the same; locating the difference requires pairwise log-rank comparisons with a multiplicity adjustment such as Bonferroni or Holm.
Frequently asked questions
What does the log-rank test actually compare?
It compares the entire survival experience of groups over the full follow-up period, not just survival at a single time point. At each event time it asks whether the observed number of events in each group matches what would be expected if all groups shared the same survival distribution. The accumulated discrepancy produces the chi-square test statistic.
What is the proportional-hazards assumption, and how do I check it?
The proportional-hazards assumption requires that the hazard ratio between groups remains constant over time, which in practice means the Kaplan-Meier curves should not cross. The standard graphical check is a log-log plot: plot log(−log(S(t))) against log(t) for each group and inspect whether the resulting curves are approximately parallel. Crossing lines are a warning that the log-rank test may give misleading results.
What should I do after a significant log-rank result?
Report the chi-square statistic with its degrees of freedom and p-value, then follow up with Cox regression to obtain a hazard ratio and 95% confidence interval; the log-rank test alone does not quantify the size of the difference. With a single binary group indicator, the log-rank test is virtually identical to the score test from a Cox model containing that indicator, so the Cox fit gives the same test together with a hazard ratio and confidence interval. If covariates need to be controlled, use the Cox model directly. If a confounding variable is suspected, a stratified log-rank test can adjust for it while remaining non-parametric; the score test from a stratified Cox model corresponds to the stratified log-rank test.
How does the log-rank test differ from the Wilcoxon (Breslow) test for survival data?
Both compare survival curves, but they weight event times differently. The log-rank test weights all event times equally, giving it the best power when the proportional-hazards assumption holds. The Wilcoxon-Breslow-Gehan test weights by the number at risk at each event time, so it emphasises early differences. When curves diverge early and then converge, Wilcoxon-Breslow may be more sensitive; when differences are constant or emerge later, log-rank is preferred.
Related methods
Sources
Mantel, N. (1966). Evaluation of Survival Data and Two New Rank Order Statistics Arising in Its Consideration. Cancer Chemotherapy Reports, 50(3), 163–170.
Open publication referenceKleinbaum, D. G. & Klein, M. (2012). Survival Analysis: A Self-Learning Text (3rd ed.). Springer.
ISBN: 978-14419664522015_Book_RegressionModelingStrategies, Section 20.4 'Test Statistics'; page not recorded in library