{
  "slug": "log-rank-test",
  "term": "Log-rank test",
  "aliases": [
    "Logrank test",
    "Mantel log-rank test"
  ],
  "definition": "The log-rank test compares survival distributions by accumulating observed-minus-expected events over event-time risk sets.",
  "note": "For two groups, the null hypothesis is equality of their survival distributions. At each event time, expected events in group A equal total events times A's share of the risk set. Sum observed minus expected events and divide by its estimated standard deviation to obtain Z. [scipy-logrank]\n\nTied events use a hypergeometric variance. Z squared has an asymptotic chi-square reference distribution with one degree of freedom under the null; SciPy returns signed Z instead. A zero total variance leaves this standardized comparison undefined. [scipy-logrank] [r-logrank-code]\n\nThe ordinary comparison assumes independent units and non-informative right censoring within groups. Use a common event definition and time origin; repeated telemetry rows are not independent drives. Different censoring rates alone do not imply informative censoring. [uno-2015]\n\nCrossing effects can cancel in the accumulated score, reducing power. Proportional hazards is not a universal requirement for asymptotic null validity, and a large p-value does not establish equal reliability. A test result is not an effect-size estimate. [uno-2015]\n\nAn unstratified comparison does not adjust for fleet composition or workload and does not establish causation. Stratification specifies a different comparison; complex covariate questions need an appropriate model. [r-survdiff]",
  "related": [
    "p-value",
    "kaplan-meier-estimator",
    "risk-set",
    "informative-censoring"
  ],
  "citations": [
    {
      "id": "scipy-logrank",
      "title": "SciPy 1.16.1: logrank, null hypothesis, tied-event variance and signed statistic",
      "url": "https://docs.scipy.org/doc/scipy-1.16.1/reference/generated/scipy.stats.logrank.html",
      "accessed": "2026-11-19"
    },
    {
      "id": "uno-2015",
      "title": "Uno et al. (2015): A versatile test for equality of two survival functions based on weighted differences of Kaplan-Meier curves",
      "url": "https://pmc.ncbi.nlm.nih.gov/articles/PMC4626406/",
      "accessed": "2026-11-19"
    },
    {
      "id": "r-survdiff",
      "title": "R survival: survdiff, ordinary log-rank and stratified comparisons",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/survival/html/survdiff.html",
      "accessed": "2026-11-19"
    },
    {
      "id": "r-logrank-code",
      "title": "R survival: survdiff2.c at 0605821347ef, tied observations and the one-unit variance boundary",
      "url": "https://github.com/therneau/survival/blob/0605821347efb8630d15710a6bf24ff64396c4d3/src/survdiff2.c",
      "accessed": "2026-11-19"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-19"
}
