Survival & Reliability calculator

Log-rank test calculator

Compare survival curves between two or more independent groups using the non-parametric log-rank test (Mantel-Cox test).

Run this test live in StatLab npm i @statlab/core

When to use it

Use to test whether two or more survival distributions differ significantly.

Required Inputs

  • Group A durations & status
  • Group B durations & status
  • Alternative hypothesis

Mathematical Formula

χ² = [ Σ (O_1j - E_1j) ]² / Σ V_j, where E_1j = n_1j (d_j / n_j)

Reporting Cautions

  • Assumes proportional hazards across groups over time.
  • Non-parametric test; does not estimate magnitude of hazard ratio directly (use Cox model).

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from lifelines.statistics import logrank_test
res = logrank_test(durations_a, durations_b, event_observed_A=status_a, event_observed_B=status_b)
print(f"p={res.p_value:.4f}")
R Language
library(survival)
survdiff(Surv(time, status) ~ group)
TypeScript (@statlab/core)
import { logRankTest } from '@statlab/core';
const res = logRankTest(groupA, groupB);

Developer Use Cases & Production Integrations

  • Comparing process failure rates between software patch builds.
  • Evaluating node crash survival times across deployment clusters.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.