Log-Rank Test Calculator

The Log-Rank Test Calculator compares survival curves between two groups to determine if their survival distributions are statistically different. Enter your observed events, expected events, and sample sizes for each group, then set your significance level (α). You'll get the chi-square statistic, p-value, and a clear significance decision — all based on the Mantel-Haenszel log-rank method.

The probability threshold for statistical significance.

ρ = 0 is the standard log-rank test; ρ = 1 applies the Peto & Peto modification (Gehan-Wilcoxon).

Total number of subjects in Group 1.

Number of events (e.g. deaths) observed in Group 1.

Total number of subjects in Group 2.

Number of events (e.g. deaths) observed in Group 2.

Results

P-Value

--

Chi-Square Statistic

--

Expected Events — Group 1

--

Expected Events — Group 2

--

Degrees of Freedom

--

Result

--

Observed vs Expected Events by Group

Results Table

Frequently Asked Questions

What is the log-rank test?

The log-rank test (also known as the Mantel-Haenszel test) is a non-parametric statistical test used to compare the survival distributions of two or more groups. It tests the null hypothesis that there is no difference in survival rates between groups over time. A significant result (low p-value) indicates that at least one group has a different survival experience.

What is the difference between the log-rank test (ρ = 0) and the Peto-Wilcoxon test (ρ = 1)?

When ρ = 0, you get the standard log-rank test (Mantel-Haenszel), which weights all time points equally and is most powerful when hazards are proportional. When ρ = 1, the Peto & Peto modification of the Gehan-Wilcoxon test is applied, which gives more weight to early time points. Choose ρ = 1 if you expect the survival differences to be larger early in the follow-up period.

How do I interpret the p-value from the log-rank test?

If the p-value is less than or equal to your chosen significance level (α), you reject the null hypothesis and conclude that there is a statistically significant difference in survival between the groups. For example, with α = 0.05, a p-value of 0.03 would be significant. A p-value above α suggests insufficient evidence to conclude the survival curves differ.

What are observed and expected events in the log-rank test?

Observed events (O) are the actual number of events (e.g., deaths or failures) recorded in each group during the study. Expected events (E) are the number of events that would be anticipated in each group if the null hypothesis (equal survival) were true, calculated based on the proportion of subjects at risk at each event time. The log-rank statistic is derived from the difference between O and E.

Can the log-rank test be used for more than two groups?

Yes. When comparing more than two groups, the log-rank test becomes an omnibus test — it indicates whether any significant difference exists among the groups, but does not specify which pairs of groups differ. To identify which groups are significantly different from each other, post-hoc pairwise comparisons with a Bonferroni correction are recommended.

What does the chi-square statistic represent in this test?

The log-rank test statistic follows a chi-square distribution under the null hypothesis. It is calculated as the sum of (O−E)²/E across all groups and event times. A larger chi-square value indicates a greater discrepancy between observed and expected events, leading to a smaller p-value and stronger evidence against the null hypothesis. Degrees of freedom equal the number of groups minus one.

What is the Kaplan-Meier curve and how does it relate to the log-rank test?

The Kaplan-Meier curve is a step function that estimates the survival probability over time for each group. The log-rank test provides the formal statistical comparison of these curves. While the Kaplan-Meier plot shows you visually which group appears to have better survival, the log-rank test tells you whether that visual difference is statistically significant.

What assumptions does the log-rank test make?

The log-rank test assumes proportional hazards between groups (i.e., the ratio of hazard rates is constant over time), that censoring is non-informative (censored subjects are as likely to experience the event as those still observed), and that events are independent. If the proportional hazards assumption is violated, the Peto-Wilcoxon modification (ρ = 1) or other weighted tests may be more appropriate.

More Statistics Tools