# 对数秩检验

对数秩检验是一种非参数假设检验，用于比较两组或多组在含删失观测的事件发生时间数据中的生存分布。其零假设为：在整个随访期内，任意时间点上各组人群发生事件（如死亡）的概率均无差异，且不对生存分布的形状作任何特定假设。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup> 近期超过95%的癌症随机对照试验单独使用对数秩检验来检测治疗差异，使其成为比较两条生存函数的主要工具。<sup>[2](https://web.stanford.edu/~lutian/coursepdf/stat331-twosample.pdf)</sup> 它纯粹是一种显著性检验：只给出p值，而不估计差异的大小或置信区间。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup>

| 要点 | 说明 |
|---|---|
| 零假设 | 任意时间点上事件概率均无差异<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup> |
| 检验统计量 | \( Z = \sum_{j} (O_{j} - E_{j}) / \sqrt{\sum_{j} V_{j}} \)，在 \( H_{0} \) 下近似服从标准正态分布<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup> |
| 可处理的数据 | 右删失、左截断、事件时间结点<sup>[4](https://jhanley.biostat.mcgill.ca/bios601/SurvivalAnalysis/Mantel1966CancerChemotherapyReportsLogrankTest.pdf)</sup> |
| 所属族系 | 弗莱明–哈林顿 \( G(\rho,\gamma) \) 类中未加权的 \( G(0,0) \) 成员<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup> |
| 效能驱动因素 | 在比例风险下，效能主要取决于事件数，而非受试者人数<sup>[6](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Logrank_Tests_with_Proportional_Hazards-Schoenfeld_and_Wu.pdf)</sup> |
| 主要失效模式 | 生存曲线交叉时：观测减期望的偏差相互抵消，检验可能漏掉肉眼可见的差异<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup> |

## 工作原理

在每个不同的事件时间 \( \tau_{j} \)，各组中仍处于风险中的受试者构成一个2×2表。在边际总数固定的条件下，在 \( H_{0} \) 下，第1组的失效数 \( d_{1j} \) 服从超几何分布，其均值为 \( E_{j} = Y_{1}(\tau_{j}) \cdot d_{j} / Y(\tau_{j}) \)，方差为 \( V_{j} = Y_{0}(\tau_{j}) \cdot Y_{1}(\tau_{j}) \cdot d_{j} \cdot (Y(\tau_{j}) - d_{j}) / [Y(\tau_{j})^{2} \cdot (Y(\tau_{j}) - 1)] \)，其中 \( Y_{1} \) 和 \( Y_{0} \) 分别为两组中处于风险中的人数，\( d_{j} \) 为该时间点的总死亡数。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup> 将各事件时间点的 \( O_{j} - E_{j} \) 求和并除以总方差的平方根，得到 \( Z = \sum_{j} (O_{j} - E_{j}) / \sqrt{\sum_{j} V_{j}} \)，在 \( H_{0} \) 下近似服从 \( N(0,1) \)，或 \( Z^{2} \approx \chi^{2}_{1} \)。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup>

该统计量仅取决于死亡和失访在时间上的排序，而不取决于实际时间，因此是一种秩次序统计量。<sup>[4](https://jhanley.biostat.mcgill.ca/bios601/SurvivalAnalysis/Mantel1966CancerChemotherapyReportsLogrankTest.pdf)</sup> 该检验的方向性指向满足 \( S_{1}(t) = (S_{0}(t))^{\theta} \) 的备择假设，等价于恒定风险比 \( h_{1}(t)/h_{0}(t) = \theta \)，它作为考克斯比例风险模型偏似然的得分检验出现。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup>

## 操作方法

所需数据为每个受试者的组别、事件时间和删失指示符。假设条件为：删失与预后无关；早期和晚期招募的受试者生存概率相同；事件发生在记录的时间点。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup> 各事件时间点的期望死亡数为（该组处于风险中的人数）×（该时间点总死亡数 / 总处于风险中人数）。在布兰德和奥尔特曼的胶质瘤示例中，期望死亡总数分别为22.48和19.52，观测死亡数为14和28，得到 \( \chi^{2} = 6.88 \)，自由度为1，\( P < 0.01 \)。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup> SciPy的 `scipy.stats.logrank` 实现了相同的统计量，并返回其带符号的平方根，以便进行单侧备择检验。<sup>[7](http://scipy.github.io/devdocs/reference/generated/scipy.stats.logrank.html)</sup>

对于分层分析，在每个层内计算 \( O \)、\( E \) 和 \( V \)，然后合并为 \( Z = \sum_{l} (O^{(l)} - E^{(l)}) / \sqrt{\sum_{l} V^{(l)}} \)；层数过多时检验可能损失效能。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup> 对于 \( p+1 \) 组，综合统计量为 \( Q_{p} = (O_{\cdot} - E_{\cdot})^{\mathrm{T}} \cdot V^{-1} \cdot (O_{\cdot} - E_{\cdot}) \)，近似服从 \( \chi^{2}_{p} \)；趋势检验 \( Z_{\mathrm{tr}} = c^{\mathrm{T}} \cdot (O_{\cdot} - E_{\cdot}) / \sqrt{c^{\mathrm{T}} \cdot V \cdot c} \) 可处理有序分组，如递增剂量。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup>

## 起源

内森·曼特尔（Nathan Mantel）于1966年开发了该方法，将每个时间区间内的数据分别视为一张四格列联表，这是他与威廉·汉斯泽尔（William Haenszel）于1959年发表的分层2×2表曼特尔–汉斯泽尔方法的扩展；当区间无限小时，它成为一种秩程序。<sup>[8](https://garfield.library.upenn.edu/classics1983/A1983QB30100002.pdf)</sup><sup> • </sup><sup>[9](https://doi.org/10.1093/jnci/22.4.719)</sup> 1966年的论文《生存数据的评价及在其考量中产生的两种新秩次序统计量》提出了一种卡方程序，整体比较两组生命表数据，对较早的死亡赋予更大权重。<sup>[4](https://jhanley.biostat.mcgill.ca/bios601/SurvivalAnalysis/Mantel1966CancerChemotherapyReportsLogrankTest.pdf)</sup> 另一条平行路线始于E. A. 格汉（E. A. Gehan）1965年针对任意单删失样本的广义威尔科克森检验，曼特尔将其描述为一种竞争性程序，促使他撰写了自己的手稿。<sup>[10](https://doi.org/10.1093/biomet/52.1-2.203)</sup><sup> • </sup><sup>[8](https://garfield.library.upenn.edu/classics1983/A1983QB30100002.pdf)</sup> 因此，20世纪60年代初的工作分为两条路线：修改秩检验以允许删失（格汉）和将列联表方法适配于删失（曼特尔）。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup> 名称来自相关的评分系统：萨维奇评分本质上是逆秩对数的线性函数，而对数秩评分为该方法提供了名称。<sup>[11](https://aacrjournals.org/cancerres/article-pdf/39/11/4308/2403130/cr0390114308.pdf)</sup><sup> • </sup><sup>[8](https://garfield.library.upenn.edu/classics1983/A1983QB30100002.pdf)</sup> D. R. 考克斯（D. R. Cox）1972年的比例风险论文——对数秩检验即其得分检验——<sup>[12](https://doi.org/10.1111/j.2517-6161.1972.tb00899.x)</sup> 推动了曼特尔工作的普及。<sup>[8](https://garfield.library.upenn.edu/classics1983/A1983QB30100002.pdf)</sup>

## 变体

所有变体共享形式 \( Z_{w} = \sum_{j} w_{j} \cdot (O_{j} - E_{j}) / \sqrt{\sum_{j} w_{j}^{2} \cdot V_{j}} \)；它们仅在各事件时间点的权重 \( w_{j} \) 上不同。<sup>[3](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)</sup>

- **格汉–布雷斯洛（广义威尔科克森）：** \( w_{j} \) 等于处于风险中的人数，在随访早期最大；对早期差异敏感，但可能因差异性删失而失真。<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup>
- **塔罗恩–韦尔：** \( w_{j} \) 为处于风险中人数的平方根，是平坦加权与早期集中加权之间的折中；罗伯特·E. 塔罗恩（Robert E. Tarone）和詹姆斯·韦尔（James Ware）于1977年提出。<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup><sup> • </sup><sup>[13](https://doi.org/10.1093/biomet/64.1.156)</sup>
- **皮托–皮托（皮托–普伦蒂斯）：** \( w_{j} \) 为皮托–皮托的修正生存估计 \( \tilde{S}(t_{j}) = \prod_{t_{i} < t_{j}} (1 - d_{i}/(n_{i}+1)) \)，是合并卡普兰–迈耶估计的修正形式，比格汉–布雷斯洛更耐删失；相关的皮托–普伦蒂斯变体使用合并卡普兰–迈耶估计的 \( S(t_{j}^{-}) \)。<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup>
- **弗莱明–哈林顿 \( G(\rho,\gamma) \)：** 由大卫·P. 哈林顿（David P. Harrington）和托马斯·R. 弗莱明（Thomas R. Fleming）于1982年提出；\( (0,0) \) 为标准对数秩检验，\( (1,0) \) 强调早期差异，\( (0,1) \) 强调晚期差异，如延迟治疗效应。<sup>[14](https://doi.org/10.1093/biomet/69.3.553)</sup>

进一步的扩展包括基于宋阳（Song Yang）和罗斯·普伦蒂斯（Ross Prentice）模型的自适应加权检验，该检验在比例风险下保持最优性，同时在多种非比例备择下提高效能；<sup>[15](https://doi.org/10.1111/j.1541-0420.2009.01243.x)</sup> 多米尼克·马吉尔（Dominic Magirr）和卡尔-弗雷德里克·伯曼（Carl-Fredrik Burman）（2019）的适度加权检验；<sup>[16](https://doi.org/10.1002/sim.8186)</sup> 以及针对免疫治疗延迟效应和治愈率设计的加权检验。<sup>[17](https://doi.org/10.1002/pst.1878)</sup><sup> • </sup><sup>[18](https://doi.org/10.1002/sim.7157)</sup> 卡里森（Karrison）的多功能检验（2016）取相关加权对数秩统计量中的最大值。<sup>[19](https://doi.org/10.1177/1536867x1601600308)</sup>

## 应用

在比例风险下，效能主要由观察到的事件数决定；指数分布假设仅用于将计划样本量转换为预期事件数。<sup>[6](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Logrank_Tests_with_Proportional_Hazards-Schoenfeld_and_Wu.pdf)</sup> L. S. 弗里德曼（L. S. Freedman）于1982年发表了所需患者数的表格。<sup>[20](https://doi.org/10.1002/sim.4780010204)</sup> 大卫·舍恩菲尔德（David Schoenfeld）1981年的渐近结果为舍恩菲尔德公式奠定了基础。<sup>[21](https://doi.org/10.1093/biomet/68.1.316)</sup><sup> • </sup><sup>[6](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Logrank_Tests_with_Proportional_Hazards-Schoenfeld_and_Wu.pdf)</sup> 拉钦–福克斯方法（Lachin–Foulkes，1986）允许非均匀入组、失访、不依从和分层，<sup>[22](https://doi.org/10.2307/2531201)</sup> 拉卡托斯（Lakatos，1988）将样本量计算扩展到复杂试验特征。<sup>[23](https://doi.org/10.2307/2531910)</sup> 统一方法涵盖了优效性、非劣效性和等效性设计中的未加权和加权检验，包括非比例风险。<sup>[24](https://journals.sagepub.com/doi/10.1177/0962280220988570)</sup> 在免疫肿瘤学实践中，一项发表于《美国医学会肿瘤学杂志》的荟萃分析纳入63项研究、35,902名患者和150项比较，发现对数秩检验与MaxCombo在135项（90%）中一致，而在所有15项不一致的案例中MaxCombo均名义显著，支持MaxCombo作为预期偏离比例风险时的实用替代方案。<sup>[25](https://europepmc.org/article/pmc/pmc9305601)</sup> 一项与欧洲药品管理局有关联的系统综述纳入211篇文章，发现对于非比例风险下的最佳方法尚无共识；对数秩方法仍是所查文献中最常用的假设检验方法。<sup>[26](https://catalogues.ema.europa.eu/sites/default/files/document_files/Literature%20Review%20Rev.%202.pdf)</sup>

## 局限与替代方案

该检验假设删失与预后无关，且当生存曲线交叉时不太可能检测到差异，这在比较内科与外科干预时可能发生。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup> 曲线交叉时，两个阶段中观测减期望的偏差方向相反，在平坦加权下部分抵消，导致肉眼可见不同的曲线产生不显著的p值。<sup>[5](https://www.casrai.org/guides/log-rank-test-and-its-variants)</sup> 在KEYNOTE-042的曲线交叉的无进展生存数据上，标准对数秩检验不显著，风险比估计为1.07，而晚期强调加权检验拒绝了零假设，支持帕博利珠单抗，单侧 \( P < .0001 \)。<sup>[27](https://pmc.ncbi.nlm.nih.gov/articles/PMC7001779/)</sup> 与考克斯模型相比，对数秩检验不给出效应估计；两者通常一致，因为对数秩检验就是考克斯得分检验，且模拟显示对数秩检验在比例风险下往往具有略高的效能。<sup>[1](https://www.bmj.com/content/328/7447/1073)</sup><sup> • </sup><sup>[24](https://journals.sagepub.com/doi/10.1177/0962280220988570)</sup> 基于RMST的检验依赖于所选定的限制时间 \( \tau \)，选择不当的 \( \tau \) 可能夸大显著性。<sup>[27](https://pmc.ncbi.nlm.nih.gov/articles/PMC7001779/)</sup> 多功能检验和最大型检验存在方向性问题：在相同的KEYNOTE-042数据上，卡里森最大检验和MaxCombo均既拒绝零假设支持帕博利珠单抗，又拒绝零假设支持化疗（两个方向单侧 \( P < .0001 \)）。<sup>[27](https://pmc.ncbi.nlm.nih.gov/articles/PMC7001779/)</sup> 一个跨制药工作组对九种情景的模拟发现，所有检验均能很好地控制I类错误，且不存在在所有情景下都最有功效的单一检验；在无先验知识了解非比例模式的情况下，MaxCombo相对稳健。<sup>[28](https://www.tandfonline.com/doi/full/10.1080/19466315.2019.1697738)</sup> 弗雷德林（Freidlin）和科恩（Korn）认为，基于对数秩的设计在样本量增加约10%、额外随访和修改的期中无效性分析下，可在延迟效应下提供稳健的效能，替代方案更适合作为次要分析。<sup>[27](https://pmc.ncbi.nlm.nih.gov/articles/PMC7001779/)</sup> 一种整合RMST和生存加权平均风险的长期平均风险方法被引入，用于在无模型假设下检验和估计延迟治疗获益，在删失较轻时在许多延迟差异模式下显示出比考克斯风险比检验更高的效能。<sup>[29](https://link.springer.com/article/10.1007/s10985-025-09671-0)</sup><sup> • </sup><sup>[30](https://doi.org/10.1002/sim.9651)</sup>

## References

1. [Bland JM, Altman DG. The logrank test. BMJ 2004;328:1073](https://www.bmj.com/content/328/7447/1073)
2. [STAT331 Large Sample Theory for 2-Sample Tests](https://web.stanford.edu/~lutian/coursepdf/stat331-twosample.pdf)
3. [Logrank Test (survival analysis course unit, Stanford)](https://web.stanford.edu/~lutian/coursepdf/unitweek3.pdf)
4. [Mantel N. (1966). Evaluation of survival data and two new rank order statistics arising in its consideration. Cancer Chemotherapy Reports 50:163-170 (scanned full text)](https://jhanley.biostat.mcgill.ca/bios601/SurvivalAnalysis/Mantel1966CancerChemotherapyReportsLogrankTest.pdf)
5. [The Log-Rank Test and Its Variants: When Equal Weighting Loses Power (CASRAI guide)](https://www.casrai.org/guides/log-rank-test-and-its-variants)
6. [PASS documentation: Logrank Tests with Proportional Hazards (Schoenfeld and Wu)](https://www.ncss.com/wp-content/themes/ncss/pdf/Procedures/PASS/Logrank_Tests_with_Proportional_Hazards-Schoenfeld_and_Wu.pdf)
7. [scipy.stats.logrank, SciPy documentation](http://scipy.github.io/devdocs/reference/generated/scipy.stats.logrank.html)
8. [This Week's Citation Classic: Mantel N. Evaluation of survival data and two new rank order statistics arising in its consideration. Cancer Chemother. Rep. 50:163-70, 1966 (Mantel's own commentary, 1982)](https://garfield.library.upenn.edu/classics1983/A1983QB30100002.pdf)
9. [Nathan Mantel, William Haenszel (1959). Statistical Aspects of the Analysis of Data From Retrospective Studies of Disease. JNCI Journal of the National Cancer Institute.](https://doi.org/10.1093/jnci/22.4.719)
10. [E. A. Gehan (1965). A generalized Wilcoxon test for comparing arbitrarily singly-censored samples. Biometrika.](https://doi.org/10.1093/biomet/52.1-2.203)
11. [Use of Logrank Scores in the Analysis of Litter-matched Data on Time to Tumor Response (Cancer Research 39:4308, 1979)](https://aacrjournals.org/cancerres/article-pdf/39/11/4308/2403130/cr0390114308.pdf)
12. [D. R. Cox (1972). Regression Models and Life-Tables. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1972.tb00899.x)
13. [ROBERT E. TARONE, JAMES WARE (1977). On distribution-free tests for equality of survival distributions. Biometrika.](https://doi.org/10.1093/biomet/64.1.156)
14. [DAVID P. HARRINGTON, THOMAS R. FLEMING (1982). A class of rank test procedures for censored survival data. Biometrika.](https://doi.org/10.1093/biomet/69.3.553)
15. [Song Yang, Ross Prentice (2009). Improved Logrank‐Type Tests for Survival Data Using Adaptive Weights. Biometrics.](https://doi.org/10.1111/j.1541-0420.2009.01243.x)
16. [Dominic Magirr, Carl‐Fredrik Burman (2019). Modestly weighted logrank tests. Statistics in Medicine.](https://doi.org/10.1002/sim.8186)
17. [Shufang Liu, Chenghao Chu, Alan Rong (2018). Weighted log‐rank test for time‐to‐event data in immunotherapy trials with random delayed treatment effect and cure rate. Pharmaceutical Statistics.](https://doi.org/10.1002/pst.1878)
18. [Zhenzhen Xu and colleagues (2016). Designing therapeutic cancer vaccine trials with delayed treatment effect. Statistics in Medicine.](https://doi.org/10.1002/sim.7157)
19. [Theodore G. Karrison (2016). Versatile Tests for Comparing Survival Curves Based on Weighted Log-rank Statistics. The Stata Journal Promoting communications on statistics and Stata.](https://doi.org/10.1177/1536867x1601600308)
20. [L. S. Freedman (1982). Tables of the number of patients required in clinical trials using the logrank test. Statistics in Medicine.](https://doi.org/10.1002/sim.4780010204)
21. [DAVID SCHOENFELD (1981). The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika.](https://doi.org/10.1093/biomet/68.1.316)
22. [John M. Lachin, Mary A. Foulkes (1986). Evaluation of Sample Size and Power for Analyses of Survival with Allowance for Nonuniform Patient Entry, Losses to Follow-Up, Noncompliance, and Stratification. Biometrics.](https://doi.org/10.2307/2531201)
23. [Edward Lakatos (1988). Sample Sizes Based on the Log-Rank Statistic in Complex Clinical Trials. Biometrics.](https://doi.org/10.2307/2531910)
24. [A unified approach to power and sample size determination for log-rank tests under proportional and nonproportional hazards (Tang, 2021, Statistical Methods in Medical Research)](https://journals.sagepub.com/doi/10.1177/0962280220988570)
25. [Log-Rank Test vs MaxCombo and Difference in Restricted Mean Survival Time Tests for Comparing Survival Under Nonproportional Hazards in Immuno-oncology Trials: A Systematic Review and Meta-analysis (JAMA Oncology 2022)](https://europepmc.org/article/pmc/pmc9305601)
26. [Report on the systematic literature review: Statistical analysis of trials where non proportional hazards are expected (EMA catalogue document)](https://catalogues.ema.europa.eu/sites/default/files/document_files/Literature%20Review%20Rev.%202.pdf)
27. [Methods for Accommodating Nonproportional Hazards in Clinical Trials: Ready for the Primary Analysis? (Freidlin & Korn, J Clin Oncol)](https://pmc.ncbi.nlm.nih.gov/articles/PMC7001779/)
28. [Alternative Analysis Methods for Time to Event Endpoints Under Nonproportional Hazards: A Comparative Analysis (Statistics in Biopharmaceutical Research, 2020)](https://www.tandfonline.com/doi/full/10.1080/19466315.2019.1697738)
29. [Assessing delayed treatment benefits of immunotherapy using long-term average hazard: a novel test/estimation approach (Lifetime Data Analysis, 2025)](https://link.springer.com/article/10.1007/s10985-025-09671-0)
30. [Hajime Uno, Miki Horiguchi (2023). Ratio and difference of average hazard with survival weight: New measures to quantify survival benefit of new therapy. Statistics in Medicine.](https://doi.org/10.1002/sim.9651)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Hypothesis testing

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/log-rank-test

English original: https://www.edgepedia.org/log-rank-test
