# 条件推断（统计学）

条件推断是一种用于假设检验和估计的统计方法，它以辅助统计量或冗余参数的充分统计量为条件，从而将未知参数从推断问题中消去。若给定某统计量后数据的条件分布不依赖于参数，则该统计量是充分的；若统计量自身的分布不依赖于参数，则它是辅助的。因此，充分统计量携带关于参数的全部信息，而辅助统计量不携带任何参数信息，却描述数据的精确程度。<sup>[1](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)</sup><sup> • </sup><sup>[2](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/07%3A_Point_Estimation/7.06%3A_Sufficient_Complete_and_Ancillary_Statistics)</sup> 以冗余参数的充分统计量为条件，会完全消去该参数，从而允许精确条件检验和置信区间；以辅助统计量为条件，则把推断限制在实际观测到的实验配置内。这一方法构成了列联表的费希尔（Fisher）精确检验、匹配研究的条件逻辑回归，以及较晚近的条件随机化检验的基础。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup><sup> • </sup><sup>[4](https://www.ism.ac.jp/editsec/aism/pdf/045_1_0055.pdf)</sup>

| 关键事实 | 取值或陈述 |
|---|---|
| 以什么为条件 | 辅助统计量，或冗余参数的充分统计量，其条件分布不含参数<sup>[1](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)</sup><sup> • </sup><sup>[4](https://www.ism.ac.jp/editsec/aism/pdf/045_1_0055.pdf)</sup> |
| 条件性原理 | 若 \( A \) 对模型 \( M \) 是辅助的，则 \( \mathrm{Ev}(M, x) = \mathrm{Ev}(M \mid A(x), x) \)<sup>[5](https://link.springer.com/article/10.1007/s13171-022-00295-2)</sup> |
| 2×2精确条件分布律 | 非中心超几何分布<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup> |
| 品茶优势比 | 无条件最大似然估计为9；条件最大似然估计为6.41；精确条件95%区间为(0.21, 626.2)<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup> |
| “精确”区间的覆盖率 | 至少为 \( 1-\alpha \)；除非真实优势比是可达到的端点，否则严格大于 \( 1-\alpha \)，因为条件分布是离散的<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup> |
| 条件化的功效代价 | 可能非常小：在一个正态混合示例中，无条件拒绝阈值为0.598和2.392，条件拒绝阈值为0.645和2.290<sup>[6](https://www.math.wustl.edu/~kuffner/papers/KuffnerYoung2017a.pdf)</sup> |
| 现代形式 | 条件随机化检验对任意检验统计量都能精确且非渐近地控制第一类错误<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC10323874/)</sup> |

## 工作原理

条件性原理指出，若 \( A \) 对模型 \( M \) 是辅助的，则来自模型和数据的证据等于将模型限制在 \( A \) 的观测值后得到的证据：\( \mathrm{Ev}(M, x) = \mathrm{Ev}(M \mid A(x), x) \)。<sup>[5](https://link.springer.com/article/10.1007/s13171-022-00295-2)</sup> 其理由是，辅助统计量具有不依赖于参数的固定分布，因此其观测值不携带关于参数本身的信息，却指示实验的精确度；以它为条件，可以恢复因将数据约简为最大似然估计量而本来会丢失的信息。<sup>[1](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)</sup><sup> • </sup><sup>[8](https://utstat.toronto.edu/reid/research/A20n41.pdf)</sup>

考克斯（Cox）的双仪器例子展示了这一机制。指示变量 \( a \) 记录使用的是两台测量仪器中的哪一台；无论参数取何值，它以各1/2的概率等于1或2，因此是辅助的。条件方法使用实际所用仪器的正态模型，其标准差分别为 \( 100\sigma_{0} \) 和 \( \sigma_{0} \)，而不是对两个精确度水平取平均的单一模型。<sup>[1](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)</sup>

两个结构性事实使该原理复杂化。第一，充分性与辅助性适合一个共同的条件独立性框架，正如A. P. 道维德（A. P. Dawid）1979年发表于《皇家统计学会杂志B辑》的论文《统计理论中的条件独立性》所述。<sup>[9](https://doi.org/10.1111/j.2517-6161.1979.tb01052.x)</sup> 第二，在同一情境中可能存在多个极大辅助统计量，这使得条件性原理不能成为等价关系；将条件化限制到极小辅助统计量——其中唯一的最大元是层状辅助统计量——可恢复一个稳定的原理。<sup>[5](https://link.springer.com/article/10.1007/s13171-022-00295-2)</sup>

## 操作方式

条件检验分三步进行。第一，确定用于条件化的冗余参数充分统计量或辅助统计量。第二，给定该统计量的观测值，构造其余数据的条件分布；对于边际总数固定的2×2表，这就是非中心超几何分布。第三，计算条件尾部概率作为p值，并通过反演一族条件检验得到置信区间。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup>

对逻辑回归，同样的逻辑给出条件逻辑回归：对参数 \( \pi_{j} \) 的精确推断，使用其充分统计量 \( T_{j} \) 在其余充分统计量 \( \{T_{i}, i \neq j\} \) 观测值条件下的分布。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup> 由于冗余参数在条件模型中被完全消去，条件检验和置信区间可以在没有本质困难的情况下建立。<sup>[4](https://www.ism.ac.jp/editsec/aism/pdf/045_1_0055.pdf)</sup>

计算是实际约束，因为条件分布的支撑集必须被枚举或抽样。标准策略是网络算法和蒙特卡洛模拟；R的 `fisher.test()` 实现了两者，默认使用网络算法。<sup>[10](https://www.ism.ac.jp/editsec/aism/70/0983.pdf)</sup>

## 起源

以辅助统计量为条件、特别是以列联表边际总数为条件的想法，引出了如今称为费希尔精确检验的2×2表精确检验；辅助性的标准定义沿用巴苏（Basu，1964）。<sup>[1](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)</sup><sup> • </sup><sup>[8](https://utstat.toronto.edu/reid/research/A20n41.pdf)</sup><sup> • </sup><sup>[11](https://spiral.imperial.ac.uk/bitstreams/875bb1f2-403d-4086-b14c-0b5d3a9a3788/download)</sup> 1937年《皇家学会会刊A辑》的论文《充分性与统计检验的性质》建立在费希尔的辅助信息概念之上。<sup>[12](https://royalsocietypublishing.org/doi/pdf/10.1098/rspa.1937.0109)</sup>

艾伦·伯恩鲍姆（Allan Birnbaum）1962年发表于《美国统计协会杂志》的论文《论统计推断的基础》强调条件实验参照系，并将之归功于费希尔、D. R. 考克斯和J. W. 图基（J. W. Tukey）等人，同时证明条件性原理与充分性一起导致似然原理。<sup>[13](https://doi.org/10.1080/01621459.1962.10480660)</sup>

## 变体

**列联表。** 对2×2及更大列联表的精确条件推断以边际总数为条件，并使用非中心超几何分布律；优势比的精确置信区间通过反演条件检验得到。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup>

**匹配病例对照研究。** 条件逻辑回归是匹配数据的标准方法。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup><sup> • </sup><sup>[14](https://ar5iv.labs.arxiv.org/html/1610.06774)</sup>

**条件随机化检验。** 在模型X框架中，条件随机化检验（CRT）在假定 \( X \mid Z \) 已知的情况下检验给定 \( Z \) 时 \( Y \) 与 \( X \) 的条件独立性，其p值为

\[ p = \frac{1}{M+1}\left[ 1 + \sum_{m=1}^{M} \mathbf{1}\{ T(y, x^{(m)}, Z) \geq T(y, x, Z) \} \right] \]

其中对 \( M \) 个从 \( x \mid Z \) 的分布中重抽样得到的 \( x^{(m)} \) 求和，并且对所有 \( \alpha \) 满足 \( P_{H0}(p \leq \alpha) \leq \alpha \)，在任意维数下精确且非渐近地控制第一类错误。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC10323874/)</sup>

## 应用

**软件。** 逻辑模型的精确条件方法长期主要见于商业软件包LogXact和SAS；`elrm` 通过MCMC将其扩展到大型数据集，<sup>[15](https://cran.r-project.org/web/packages/elrm/vignettes/elrm.pdf)</sup> R包 `cond` 实现了逻辑模型和对数线性模型的近似条件推断。<sup>[16](https://cran.r-project.org/web/packages/cond/cond.pdf)</sup>

**定量示例。** 对费希尔的品茶数据，优势比的无条件最大似然估计为9，而最大化条件似然的条件最大似然估计为6.41；精确条件95%置信区间为(0.21, 626.2)，其宽度反映了条件分布的离散性。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup>

**高维检验。** 蒸馏条件随机化检验（dCRT）将昂贵的高维拟合执行一次，而不是 \( M+1 \) 次，在计算量少几个数量级的情况下达到与现有CRT实现相近的功效，并产生有限样本有效的p值，可用于错误发现率和族错误率控制。<sup>[7](https://pmc.ncbi.nlm.nih.gov/articles/PMC10323874/)</sup>

## 局限与替代方法

**离散性与保守性。** 2×2表统计量的条件分布高度离散，因此费希尔精确检验在诸如 \( \alpha = 0.05 \) 的固定显著性水平上是保守的。精确区间覆盖率至少为 \( 1-\alpha \)，并且除非真实优势比是可达到的端点，否则严格大于 \( 1-\alpha \)（奈曼，1935）。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup> 对于不是优势比函数的关联度量，例如概率差，也无法构造精确条件区间，因为以边际总数为条件并不能消去冗余参数。<sup>[3](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)</sup>

**信息损失。** 条件变量可能包含关于兴趣参数的信息，而将其固定时会丢失这些信息；在存在冗余参数时，它仅当其边际密度不依赖于冗余参数时才对兴趣参数是辅助的，而这在一般情况下并不成立。<sup>[8](https://utstat.toronto.edu/reid/research/A20n41.pdf)</sup> 对于大样本，估计量的条件方差排序可能与无条件排序相反，正如奈曼和斯科特（Neyman and Scott，1948）所暗示的那样。<sup>[4](https://www.ism.ac.jp/editsec/aism/pdf/045_1_0055.pdf)</sup>

**条件化与功效。** 条件化与最大化功效相悖，但损失可能非常小，正如一个正态混合示例所示。<sup>[6](https://www.math.wustl.edu/~kuffner/papers/KuffnerYoung2017a.pdf)</sup> 辅助性悖论是指这样一种程序：它对辅助统计量的每个取值都是条件可容许的，却是无条件不可容许的（伯格，1990）。<sup>[17](https://faculty.wharton.upenn.edu/wp-content/uploads/2012/04/A-simple-ancillarity-paradox.pdf)</sup> 在成对2×2表中，以列总数为条件会使一致对没有自由度，因此这些对会被完全丢弃。<sup>[18](https://link.springer.com/article/10.1007/s41884-024-00144-1)</sup>

**在各框架中的位置。** 费希尔的条件推断及其信念推断论证被视为纯贝叶斯方法与纯频率派方法之间的中间地带。<sup>[19](https://www.stat.purdue.edu/~chuanhai/docs/MHL-cond.pdf)</sup> 其目标被扩展为以样本中任何能捕捉证据强度的统计量为条件，而不再仅以辅助统计量为条件。<sup>[20](https://arxiv.org/pdf/2502.02213)</sup>

## References

1. [Ancillaries and Conditional Inference (Statistical Science, 2004, Project Euclid)](https://projecteuclid.org/journalArticle/Download?urlId=10.1214%2F088342304000000323)
2. [7.06: Sufficient Complete and Ancillary Statistics (stats.libretexts.org)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/07%3A_Point_Estimation/7.06%3A_Sufficient_Complete_and_Ancillary_Statistics)
3. [Agresti (1992), 'A Survey of Exact Inference for Contingency Tables'](https://www.stat.cmu.edu/~brian/720/hw01/agresti-1992-exact-inference.pdf)
4. [Estimating functions for conditional inference: Many nuisance parameter case (Annals of the Institute of Statistical Mathematics)](https://www.ism.ac.jp/editsec/aism/pdf/045_1_0055.pdf)
5. [On Resolving Problems with Conditionality and Its Implications for Characterizing Statistical Evidence (Sankhya A)](https://link.springer.com/article/10.1007/s13171-022-00295-2)
6. [Kuffner & Young, 'Principled Statistical Inference in Data Science'](https://www.math.wustl.edu/~kuffner/papers/KuffnerYoung2017a.pdf)
7. [Fast and powerful conditional randomization testing via distillation](https://pmc.ncbi.nlm.nih.gov/articles/PMC10323874/)
8. [Ancillary Statistics (Reid and coauthors, University of Toronto)](https://utstat.toronto.edu/reid/research/A20n41.pdf)
9. [A. P. Dawid (1979). Conditional Independence in Statistical Theory. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1979.tb01052.x)
10. [Hybrid schemes for exact conditional inference in discrete exponential families (Annals of the Institute of Statistical Mathematics)](https://www.ism.ac.jp/editsec/aism/70/0983.pdf)
11. [Imperial College repository paper on conditional inference and Fisher's exact test](https://spiral.imperial.ac.uk/bitstreams/875bb1f2-403d-4086-b14c-0b5d3a9a3788/download)
12. [Barnard (1937), 'Properties of sufficiency and statistical tests', Proc. Roy. Soc. A](https://royalsocietypublishing.org/doi/pdf/10.1098/rspa.1937.0109)
13. [Allan Birnbaum (1962). On the Foundations of Statistical Inference. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1962.10480660)
14. [Asymptotic equivalence of paired Hotelling test and conditional logistic regression (arXiv)](https://ar5iv.labs.arxiv.org/html/1610.06774)
15. [elrm: Software Implementing Exact-like Inference for Logistic Regression Models (R package vignette)](https://cran.r-project.org/web/packages/elrm/vignettes/elrm.pdf)
16. [cond: Approximate Conditional Inference for Logistic and Loglinear Models (R package)](https://cran.r-project.org/web/packages/cond/cond.pdf)
17. [A Simple Ancillarity Paradox](https://faculty.wharton.upenn.edu/wp-content/uploads/2012/04/A-simple-ancillarity-paradox.pdf)
18. [Maximal co-ancillarity and maximal co-sufficiency (Information Geometry, 2024)](https://link.springer.com/article/10.1007/s41884-024-00144-1)
19. [Martin, Han & Liu (Purdue), 'General theory of inferential models I. Conditional inference'](https://www.stat.purdue.edu/~chuanhai/docs/MHL-cond.pdf)
20. [Conditional inference and conditioning on sample statistics (arXiv 2025)](https://arxiv.org/pdf/2502.02213)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/conditional-inference-statistics

English original: https://www.edgepedia.org/conditional-inference-statistics
