Log-Rank Test Calculator

Analyze survival gaps with structured inputs and formulas. Export results for reports and audits quickly. Make evidence-based model comparisons with dependable survival testing insights.

Calculator Input

Time Point Group A At Risk Group A Events Group B At Risk Group B Events Remove

Example Data Table

This example uses grouped time points. You can load it into the calculator with one click.

Time Point Model A At Risk Model A Events Model B At Risk Model B Events
Month 1502485
Month 2483434
Month 3454396
Month 4415334
Month 5366295
Month 6304246

Formula Used

The calculator applies the standard log-rank method across all entered time points.

Total at risk at time i: nᵢ = n₁ᵢ + n₂ᵢ

Total events at time i: dᵢ = d₁ᵢ + d₂ᵢ

Expected events for Group A: E₁ᵢ = dᵢ × (n₁ᵢ / nᵢ)

Variance for time i: Vᵢ = (n₁ᵢ × n₂ᵢ × dᵢ × (nᵢ − dᵢ)) / (nᵢ² × (nᵢ − 1))

Log-rank score: Z = Σ(O₁ᵢ − E₁ᵢ) / √ΣVᵢ

Chi-square: χ² = Z²

P-value: computed from the chi-square distribution with 1 degree of freedom.

How to Use This Calculator

  1. Enter names for both comparison groups.
  2. Set your alpha level, such as 0.05.
  3. Add each event time or grouped interval in order.
  4. For every row, enter the at-risk count and event count for both groups.
  5. Click the calculate button to see the test result above the form.
  6. Review the p-value, chi-square, and direction of survival difference.
  7. Download the breakdown as CSV or export the result area as PDF.

About This Log-Rank Test Calculator

Why This Tool Matters

Time-to-event analysis matters in AI and machine learning. Teams study churn, system failure, patient response, device breakdown, and delayed conversion. A log-rank test compares two survival curves across shared time points. It helps analysts see whether one model, policy, or intervention changes outcome timing, not only the final event count.

Useful AI and Machine Learning Cases

This calculator fits many practical workflows. You can compare survival between two predictive models. You can test retention strategies in subscription products. You can study failure timing in sensor-driven maintenance systems. You can also compare clinical AI support groups when outcomes are tracked over time rather than measured once.

How the Calculation Works

The method uses at-risk counts and observed events at each time point. It computes expected events for one group under the null hypothesis. Then it measures the gap between observed and expected values. Those gaps are combined with a variance term. The final statistic becomes a chi-square value and p-value.

What the Result Means

A small p-value suggests that the two survival curves are different. A large p-value suggests there is not enough evidence to separate them. The direction note helps you understand which group had fewer events than expected. Fewer observed events often point to better survival performance over the measured period.

Why Grouped Inputs Are Helpful

Many teams store data by interval instead of exact event timestamps. Grouped inputs are easier to prepare from dashboards, reports, or model monitoring tables. That makes this page useful for quick analysis. It also supports audits, stakeholder reviews, and repeatable comparisons when you want a simple browser-based workflow.

Good Practice for Better Analysis

Use consistent time ordering. Keep event definitions stable across groups. Make sure events never exceed people or items at risk. Review censoring assumptions in your source data. When results matter for production decisions, pair this test with survival plots, confidence intervals, and domain context before choosing a final action.

FAQs

1. What does a log-rank test measure?

It tests whether two survival curves differ across time. It compares observed events with expected events at each time point under the assumption that both groups share the same survival pattern.

2. Can I use grouped intervals instead of exact event times?

Yes. This calculator is built for grouped event-time rows. Each row should represent a time point or interval with at-risk and event counts for both groups.

3. What does a low p-value mean here?

A low p-value means the survival curves are unlikely to be equal under the null hypothesis. It suggests a meaningful difference in event timing between the two groups.

4. Why do I need at-risk counts?

At-risk counts are required to estimate expected events fairly at each time point. Without them, the log-rank test cannot weight each interval correctly.

5. Can this compare machine learning models?

Yes. It is useful when models are evaluated by time until churn, failure, relapse, or another event. It compares the timing pattern, not just total events.

6. Does this page draw Kaplan-Meier curves?

No. This page focuses on the log-rank hypothesis test. You can still use its statistical output alongside separate survival plots in your reporting workflow.

7. What if one row has zero events?

That row can still be included. It adds risk-set context, though its event contribution may be zero. The calculator will process it as part of the full comparison.

8. When should I avoid relying only on this result?

Do not rely on it alone when assumptions are unclear, censoring is heavy, or business impact is high. Pair it with plots, diagnostics, and domain review.

Related Calculators

brunner munzel testlevene test calculatorspearman rank correlation calculatorkolmogorov smirnov test calculatoriqr calculatorkernel density estimatorfisher exact test calculatorwilcoxon signed rank calculatorgoodman kruskal gammacramer v calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.