# 精确检验

精确检验是一种统计假设检验，其第一类错误（即拒绝一个为真的原假设）的概率在有限样本中被所选显著性水平从上方界定，从而避免了大样本近似——尽管它仍可能依赖于诸如正态性之类的分布假设。<sup>[1](https://www.sciencedirect.com/science/article/abs/pii/S0167947325000830)</sup><sup> • </sup><sup>[19](https://discdown.org/dataanalytics/testing-principles.html)</sup> 它所产生的 p 值由检验统计量在原假设下的精确分布计算得出，通常的做法是枚举或抽样所有在原假设下等可能的数据排列。这一族检验包括用于列联表的费希尔精确检验，以及 R. A. 费希尔（R. A. Fisher）于 1935 年引入的随机化（置换）检验。<sup>[2](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)</sup>

| 要点 | 说明 |
|---|---|
| 定义性特征 | 在有限样本中，第一类错误率被目标显著性水平从上方界定；精确性是一个上界，而非相等性的保证<sup>[1](https://www.sciencedirect.com/science/article/abs/pii/S0167947325000830)</sup> |
| 起源 | 费希尔于 1935 年在《实验设计》中引入随机化检验，在不假设正态性的情况下分析了达尔文的配对数据<sup>[2](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)</sup><sup> • </sup><sup>[3](https://www.tandfonline.com/doi/abs/10.1198/000313008X269576)</sup> |
| 典型例子 | 用于 2 × 2 表的费希尔精确检验，将观测到的单元格计数与边际固定的超几何分布进行比较<sup>[4](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishexac.htm)</sup> |
| 置换版本 | 在随机化假设（可交换性）下，置换检验在有限样本中实现第一类错误的精确控制<sup>[5](https://arxiv.org/abs/2406.09521)</sup> |
| 计算成本 | 两样本随机化检验需要枚举全部 \( \binom{n_1+n_2}{n_1} \) 种排列；Dataplot 将穷举枚举的样本量上限设为 22<sup>[2](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)</sup> |
| 随机抽取的排列 | 当排列为有放回抽样时，精确 p 值为 \( (b+1)/(m+1) \)，永不为零；朴素估计会将 p 值低估约 \( 1/m \)<sup>[6](https://arxiv.org/abs/1603.05766)</sup> |
| 适用范围 | 精确检验适用于连续型、二分类、计数型和事件发生时间型结局，也适用于个体层面或群体层面的随机化设计<sup>[7](https://researchmethodsresources.nih.gov/methods/additional)</sup> |

## 费希尔工作中的起源

随机化检验因费希尔 1935 年在《实验设计》中的演示而为世人所知：分析达尔文关于自花授粉与异花授粉植物的配对数据无需正态性假设；假设正态性只是比繁琐地枚举重排更为方便而已。<sup>[3](https://www.tandfonline.com/doi/abs/10.1198/000313008X269576)</sup> 与之相伴的著名例子是品茶女士：八只杯子，两种方式各备四只，以随机顺序呈上。在品茶者无法辨别的原假设下，将杯子分成两组各四只的方式共有 70 种，因此完全正确分组的概率为 \( 1/70 \)。<sup>[5](https://arxiv.org/abs/2406.09521)</sup>

费希尔最初的表述假定所有可能的排列都将被枚举。将计算限制在随机抽取的排列子集上的想法，最早由德瓦斯（Dwass）于 1957 年考察，蒙特卡洛检验则由巴纳德（Barnard）于 1963 年提出；这些论文各自给出了随机化所产生的精确 p 值的表达式。<sup>[6](https://arxiv.org/abs/1603.05766)</sup> 皮特曼（Pitman）在 1937–1938 年的三篇论文中将该方法扩展到两样本比较、相关分析和随机区组方差分析，表明置换检验并不需要从总体中随机抽样。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC6524641/)</sup><sup> • </sup><sup>[9](https://journals.sagepub.com/doi/10.1177/0013161X85021003007)</sup>

## 用于列联表的费希尔精确检验

对于 2 × 2 表，费希尔精确检验评估获得一个至少与观测表同样极端的表的概率。如果表的边际事先固定，则第 1 行第 1 列单元格中的频数作为检验统计量，并与超几何分布进行比较；此时该检验是真正精确的。当任一边际为随机时，检验仍然有效，但可能变得保守，即真实错误率低于名义水平。<sup>[4](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishexac.htm)</sup> 该检验通常用于小样本；当边际较大时，卡方检验已足够准确，而随着表维度的增加，精确枚举的计算负担会急剧增大到难以承受。<sup>[4](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishexac.htm)</sup> 梅塔（Mehta）和帕特尔（Patel）的 FEXACT 程序（ACM 算法 643）使用网络算法处理一般的 R × C 表。<sup>[4](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishexac.htm)</sup>

## 置换检验与随机化检验

用于均值相等性的两样本随机化检验的做法是：反复将合并后的观测值重新分配到大小为 \( n_1 \) 和 \( n_2 \) 的组中，计算每种排列的均值差，并报告至少与观测值同样极端的排列所占的比例。在枚举全部 \( \binom{n_1+n_2}{n_1} \) 种排列的情况下，单尾检验可获得精确 p 值；当 \( n_1 = n_2 \) 时双尾检验也可获得精确 p 值；对于样本量不等的情形，双尾 p 值是近似的。<sup>[2](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)</sup>

精确性依赖于一种称为随机化假设的群不变性质：在原假设下，观测值的联合分布在标签置换下不变，这一条件通常被称为可交换性。<sup>[5](https://arxiv.org/abs/2406.09521)</sup><sup> • </sup><sup>[10](https://digitalcommons.wayne.edu/jmasm/vol1/iss2/34/)</sup> 当该条件成立时，无论选择何种检验统计量，置换检验都是精确的，尽管统计量的选择仍决定检验功效。<sup>[11](https://web.stanford.edu/~swager/causal_inf_book.pdf)</sup> 当该假设不成立时，置换检验即使在大样本中也可能失去第一类错误控制，不过若将检验建立在渐近枢轴统计量（例如学生化两样本 t 统计量而非原始均值差）之上，则可恢复渐近有效性。<sup>[5](https://arxiv.org/abs/2406.09521)</sup><sup> • </sup><sup>[11](https://web.stanford.edu/~swager/causal_inf_book.pdf)</sup>

随机化检验与置换检验之间有所区分。随机化检验基于实际用于分配处理的随机化序列，只有在使用正确的随机化概率时才有效；置换检验则在可交换性假设下将所有数据排列视为等概率。当随机化序列等概率时（如在随机分配规则下），二者在数学上等价；但在截断二项设计等不同序列具有不同概率的设计下则不然。<sup>[12](https://academic.oup.com/jrsssa/article/189/1/497/8029788)</sup>

## 抽样排列的计算

在现代实践中，尤其是在置换检验属于最常用工具的基因组学中，排列几乎总是随机抽取而非穷举枚举。<sup>[6](https://arxiv.org/abs/1603.05766)</sup> 菲普森（Phipson）和史密斯（Smyth）表明，以极端抽样排列的比例来估计 p 值的常见做法会将 p 值低估约 \( 1/m \)（其中 \( m \) 为排列数），并且当没有任何抽样排列至少与观测值同样极端时可能返回零。<sup>[20](https://gksmyth.github.io/pubs/PermPValuesPreprint.pdf)</sup> 当排列为有放回抽取时，精确 p 值为

\[ p = \frac{b+1}{m+1}, \]

其中 \( b \) 是至少与观测统计量同样极端的抽样排列数。尽管这种低估在绝对意义上通常很小，但在多重检验情境中可能很严重，因为许多略微低估的 p 值会膨胀族系错误率。<sup>[6](https://arxiv.org/abs/1603.05766)</sup> R 包 statmod 在其 `permp` 函数中实现了这一计算：当可能排列总数至多为 10,000 时使用精确求和，否则使用快速近似。<sup>[13](https://search.r-project.org/CRAN/refmans/statmod/html/permp.html)</sup>

## 超越可交换性的扩展

若干研究方向将精确性或近似精确性扩展到标准假设不成立的情形。扬森（Janssen）于 1997 年、其后钟（Chung）和罗马诺（Romano）表明，基于学生化统计量（将样本均值差除以适当的标准误）的置换检验即使在潜在总体分布不同时也是渐近精确的，而在分布相同时则保持有限样本下精确的拒绝概率 \( \alpha \)。<sup>[14](https://www.sciencedirect.com/science/article/pii/S0304407616300021)</sup><sup> • </sup><sup>[15](https://arxiv.org/abs/1304.5939)</sup> 张（Zhang）于 2009 年提出的分割样本置换 t 检验完全放弃了可交换性假设，是渐近精确的，并可扩展到关于单一总体的假设——普通置换检验无法检验这类假设，因为其统计量对样本内置换不变。<sup>[16](https://www.sciencedirect.com/science/article/pii/S0378375809000949)</sup>

精确检验还扩展到复杂的临床试验设计。对于应答自适应试验——其分配概率依赖于观测到的结局，而基于似然的渐近推断有第一类错误膨胀的风险——条件精确检验和非条件精确检验分别推广了费希尔精确检验和巴纳德精确检验；高效的前向递推使得在标准计算机上对约 1,000 名参与者的两臂试验进行精确分析成为可能。<sup>[1](https://www.sciencedirect.com/science/article/abs/pii/S0167947325000830)</sup> 监管指南指出，在协变量自适应随机化下可采用置换检验和随机化检验来维持第一类错误控制。<sup>[17](https://www.sciencedirect.com/science/article/abs/pii/S1551714425002939)</sup>

## 实际作用

精确检验避免了基于模型的检验的分布假设——这些假设可能不成立，尤其是在小样本中——而仅依赖于手头研究所使用的随机化方案。<sup>[7](https://researchmethodsresources.nih.gov/methods/additional)</sup> 在数据违反参数回归假设的随机实验模拟中，基于线性模型的置换检验保持了与协方差分析相当的功效，而其假设由实际进行的随机化所保证。<sup>[18](https://arxiv.org/abs/1702.04851)</sup> 主要代价是计算上的：穷举枚举仅对小样本可行，而抽样排列检验需要在 p 值计算上格外小心以保持精确性。<sup>[2](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)</sup><sup> • </sup><sup>[6](https://arxiv.org/abs/1603.05766)</sup>

## References

1. [Exact statistical analysis for response-adaptive clinical trials, Computational Statistics & Data Analysis (2025)](https://www.sciencedirect.com/science/article/abs/pii/S0167947325000830)
2. [Fisher Two Sample Randomization Test, NIST Dataplot reference manual](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishrand.htm)
3. [Herbert A. David (2008). The Beginnings of Randomization Tests. The American Statistician 62(1)](https://www.tandfonline.com/doi/abs/10.1198/000313008X269576)
4. [Fisher Exact Test, NIST Dataplot reference manual](https://itl.nist.gov/div898/software/dataplot/refman1/auxillar/fishexac.htm)
5. [Ritzwoller, Romano, and Shaikh. Randomization Inference: Theory and Applications. arXiv:2406.09521](https://arxiv.org/abs/2406.09521)
6. [Phipson, B., Smyth, G. K. (2010). Permutation p-values should never be zero. arXiv:1603.05766](https://arxiv.org/abs/1603.05766)
7. [Information on Broadly Applicable Methods, NIH Research Methods Resources](https://researchmethodsresources.nih.gov/methods/additional)
8. [Randomization tests as alternative analysis methods for behavior-analytic data, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC6524641/)
9. [Eugene S. Edgington (1985). Random Assignment and Experimental Research](https://journals.sagepub.com/doi/10.1177/0013161X85021003007)
10. [Extensions of the Concept of Exchangeability and Their Applications, Journal of Modern Applied Statistical Methods](https://digitalcommons.wayne.edu/jmasm/vol1/iss2/34/)
11. [Wager, S. Causal inference book chapter on permutation tests](https://web.stanford.edu/~swager/causal_inf_book.pdf)
12. [41st Fisher Memorial Lecture: From Fisher to CARA, JRSS Series A (2024)](https://academic.oup.com/jrsssa/article/189/1/497/8029788)
13. [permp: Exact permutation p-values, R statmod documentation](https://search.r-project.org/CRAN/refmans/statmod/html/permp.html)
14. [Multivariate and multiple permutation tests, Journal of Statistical Planning and Inference (2016)](https://www.sciencedirect.com/science/article/pii/S0304407616300021)
15. [Chung, E., Romano, J. P. Exact and asymptotically robust permutation tests. arXiv:1304.5939](https://arxiv.org/abs/1304.5939)
16. [Shunpu Zhang (2009). The split sample permutation t-tests. Journal of Statistical Planning and Inference 139(10)](https://www.sciencedirect.com/science/article/pii/S0378375809000949)
17. [Adjusting confidence intervals under covariate-adaptive randomization, Contemporary Clinical Trials (2025)](https://www.sciencedirect.com/science/article/abs/pii/S1551714425002939)
18. [Ottoboni, Lewis, Salmaso. An Empirical Comparison of Parametric and Permutation Tests for Regression Analysis of Randomized Experiments. arXiv:1702.04851](https://arxiv.org/abs/1702.04851)
19. [Chapter 11 Testing principles, Data Analytics](https://discdown.org/dataanalytics/testing-principles.html)
20. [gksmyth.github.io](https://gksmyth.github.io/pubs/PermPValuesPreprint.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Estimation theory and estimator families › Robust statistics and resampling › Permutation, randomization, and exact tests

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/exact-test

English original: https://www.edgepedia.org/exact-test
