# 配对分析

配对分析是一种“设计兼分析”的方法：研究单元依据观测到的基线协变量进行配对，处理在每个配对内被分配或比较，从而使来自匹配变量的混杂由配对本身加以控制。在实验形式中，单元被独立抽样，依据观测到的基线协变量进行配对，并在每个配对中随机选取一个单元接受处理。<sup>[1](https://doi.org/10.1920/wp.cem.2019.1919)</sup> 匹配是在不接触结局的情况下进行的，这使其成为研究设计的一部分而非分析的一部分；随后用配对或分层方法对匹配样本进行分析。<sup>[2](https://doi.org/10.1214/09-sts313)</sup>

| 关键事实 | 细节 |
|---|---|
| 产出什么 | 配对内差异与配对检验；匹配本身是设计步骤，而非效应估计量。<sup>[2](https://doi.org/10.1214/09-sts313)</sup> |
| 核心假设 | 强可忽略的处理分配：给定协变量 X，处理与潜在结果独立，且 0 < P(T=1\|X) < 1。<sup>[2](https://doi.org/10.1214/09-sts313)</sup> |
| 标准卡钳值 | 线性倾向评分的 0.2 个标准差可消除方差比为 2 的正态协变量中 98% 的偏倚；0.25 个标准差是常见建议。<sup>[2](https://doi.org/10.1214/09-sts313)</sup> |
| 效率增益 | 在亚马逊机械土耳其人（Amazon Mechanical Turk）上的一项随机实验中，配对分配使标准误降低了 29%，因此一半的样本量即可达到相同的标准误。<sup>[3](https://economics.yale.edu/sites/default/files/optdesign.pdf)</sup> |
| 二值结局检验 | 麦克尼马尔检验（McNemar's test）仅使用不一致对。<sup>[4](https://doi.org/10.1007/bf02295996)</sup> |
| 标准软件 | MatchIt R 包实现了最近邻、最优配对、最优全匹配、广义全匹配、遗传、精确、粗化精确、基数与轮廓，以及子分类匹配。<sup>[5](https://cran.r-project.org/web/packages/MatchIt/vignettes/matching-methods.html)</sup> |

## 工作原理

配对数据是以配对为层的高度分层数据，因此曼特尔-亨塞尔（Mantel-Haenszel）技术适用，并可推广到一对多和多对多匹配。<sup>[6](https://profjhklopper.quarto.pub/chapter-10/)</sup>

对于连续结局，配对 t 检验将配对内结局的差值作为观测值（配对均值差检验）。<sup>[1](https://doi.org/10.1920/wp.cem.2019.1919)</sup> 对于二值结局，麦克尼马尔（McNemar，1947）提出舍弃一致对，并用参数为 \( 1/2 \) 的二项分布检验不一致对是否均等分配；<sup>[4](https://doi.org/10.1007/bf02295996)</sup> 大样本统计量为 \( Z = (n_{12} - n_{21}) / \sqrt{n_{12} + n_{21}} \)，在边际齐性下服从标准正态分布。<sup>[6](https://profjhklopper.quarto.pub/chapter-10/)</sup> 条件 logistic 回归，其 \( \mathrm{logit}[P(Y_{it}=1)] = \alpha_{i} + \beta x_{it} \)，以每层的病例数为条件对似然进行条件化，消去配对特异的截距 \( \alpha_{i} \)，而 \( e^{\beta} \) 为配对内优势比。<sup>[6](https://profjhklopper.quarto.pub/chapter-10/)</sup>

因果假设是给定所测协变量下的强可忽略性。<sup>[2](https://doi.org/10.1214/09-sts313)</sup> 罗森鲍姆与鲁宾（Rosenbaum and Rubin，1983）将倾向评分定义为给定观测协变量时被分配至处理的条件概率，并证明对该标量评分进行调整可消除由所有观测协变量导致的偏倚。<sup>[7](https://doi.org/10.1093/biomet/70.1.41)</sup>

## 实施方法

典型工作流程有五步：选择混杂变量、选择匹配算法、评估平衡、分析结局，以及进行敏感性分析。<sup>[8](https://ebpi.uzh.ch/dam/jcr:2d12b436-60af-44a4-a071-82d3d2935a99/Matching_13_06_25.pdf)</sup> 混杂变量必须在基线时测量；基线之后收集的变量不得使用。<sup>[8](https://ebpi.uzh.ch/dam/jcr:2d12b436-60af-44a4-a071-82d3d2935a99/Matching_13_06_25.pdf)</sup>

距离与卡钳值。通过最小化协变量距离来匹配单元，常用的距离为倾向评分或马氏距离（Mahalanobis distance）。<sup>[5](https://cran.r-project.org/web/packages/MatchIt/vignettes/matching-methods.html)</sup> 卡钳值是对允许距离设定的上界，例如倾向评分绝对差至多为 0.02，可剔除最差的匹配。<sup>[9](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-031219-041058)</sup>

算法与检验。贪婪最近邻匹配按顺序处理处理组单元，其结果可能比在约束下最小化总距离的最优匹配差得任意大；R 包 optmatch 中的 pairmatch 函数使用 RELAX IV 网络流算法求解该最优问题。<sup>[9](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-031219-041058)</sup> 平衡以绝对标准化均值差来评判，低于 0.1 的值视为充分。<sup>[10](https://doi.org/10.1080/03610910902859574)</sup> 针对未测量混杂的敏感性分析使用 p 值的罗森鲍姆界（Rosenbaum bounds）、霍奇斯-莱曼（Hodges-Lehmann）点估计，以及针对二值结局的 E 值。<sup>[8](https://ebpi.uzh.ch/dam/jcr:2d12b436-60af-44a4-a071-82d3d2935a99/Matching_13_06_25.pdf)</sup>

## 起源

匹配自 20 世纪上半叶起就已被使用（例如格林伍德，1945；查平，1947），但其理论基础直到 20 世纪 70 年代才出现。<sup>[2](https://doi.org/10.1214/09-sts313)</sup> 科克伦（Cochran）的《分析性研究中的匹配》（1953）是发表于《美国公共卫生杂志》（American Journal of Public Health）的早期方法学论述，<sup>[11](https://doi.org/10.2105/ajph.43.6_pt_1.684)</sup> 而配对样本效率方面的文献包括比莱维奇（Billewicz）1965 年发表于《生物统计学》（Biometrics）的实证研究。<sup>[12](https://doi.org/10.2307/2528546)</sup> 鲁宾（Rubin，1976）研究了等百分比偏倚缩减的多变量匹配方法。<sup>[13](https://doi.org/10.2307/2529342)</sup> 在实验方面，配对随机化检验出现在《实验设计》（The Design of Experiments）第三章，应用于达尔文（Darwin）的玉米（Zea mays）异花授粉与自花授粉数据。<sup>[14](https://www.sciencedirect.com/science/article/abs/pii/S0025556402001232)</sup> 今井（Imai，2008）将奈曼（Neyman）基于随机化的实验分析推广到配对设计。<sup>[15](https://doi.org/10.1002/sim.3337)</sup>

后来的关键贡献：麦克尼马尔 1947 年发表于《心理计量学》（Psychometrika）的配对二值结局检验；<sup>[4](https://doi.org/10.1007/bf02295996)</sup> 罗森鲍姆与鲁宾（1983）发表于《生物计量学》（Biometrika）的倾向评分；<sup>[7](https://doi.org/10.1093/biomet/70.1.41)</sup> 由罗森鲍姆（1989）发表于《美国统计协会杂志》（Journal of the American Statistical Association）的最小化总协变量距离的最优匹配；<sup>[16](https://doi.org/10.1080/01621459.1989.10478868)</sup> 由汉森（Hansen，2004）在同一期刊上引入的全匹配；<sup>[17](https://doi.org/10.1198/016214504000000647)</sup> 康奈特、史密斯与麦克休（Connett, Smith, and McHugh，1987）发表于《医学统计学》（Statistics in Medicine）的配对病例对照研究的样本量与功效方法；<sup>[18](https://doi.org/10.1002/sim.4780060107)</sup> 苏伊萨与舒斯特（Suissa and Shuster，1991）发表于《生物统计学》（Biometrics）的 2 × 2 配对试验的精确无条件设计与分析；<sup>[19](https://doi.org/10.2307/2532131)</sup> 以及米尔克与贝里（Mielke and Berry，1976）发表于《心理计量学》（Psychometrika）的基于秩幂的扩展配对检验类。<sup>[20](https://doi.org/10.1007/bf02291700)</sup>

## 变体

匹配比例。在 k:1 匹配中，k 超过 4 后，增大 k 带来的精度增益迅速递减，第一次之后的匹配通常较差，模拟研究发现 1:1 或 1:2 匹配在均方误差方面通常表现最佳。<sup>[5](https://cran.r-project.org/web/packages/MatchIt/vignettes/matching-methods.html)</sup>

匹配算法。除贪婪匹配与最优配对匹配之外，可用的变体还包括全匹配，它将每个处理组单元和对照组单元各分配到一个子类；<sup>[17](https://doi.org/10.1198/016214504000000647)</sup> 粗化精确匹配；<sup>[21](https://doi.org/10.1093/pan/mpr013)</sup> 遗传匹配；<sup>[22](https://doi.org/10.1162/rest_a_00318)</sup> 基数匹配；<sup>[23](https://doi.org/10.1353/obs.2018.0012)</sup> 以及近似精细平衡，它约束单元在协变量单元格上的边际分布，而不规定谁与谁匹配。<sup>[24](https://doi.org/10.1080/01621459.2014.997879)</sup>

## 应用

在所有分层随机化程序中，按协变量的标量函数对单元排序并匹配相邻单元的配对设计，能使均值差估计量的均方误差最小。<sup>[3](https://economics.yale.edu/sites/default/files/optdesign.pdf)</sup> 实际增益取决于协变量对结局的预测强度：在机械土耳其人实验中，标准误下降了 29%，使所需样本量减半。<sup>[3](https://economics.yale.edu/sites/default/files/optdesign.pdf)</sup>

推断必须尊重配对结构。两样本 t 检验与配对 t 检验在配对设计下是保守的，其在原假设下的极限拒绝概率通常严格低于名义水平；一个简单的标准误调整即可使其渐近精确，在配对内置换处理的随机化检验也是如此。<sup>[1](https://doi.org/10.1920/wp.cem.2019.1919)</sup> 在结局为二分类的倾向评分匹配样本中，配对方法（麦克尼马尔检验、配对标准误）给出的第一类错误率和 95% 置信区间覆盖率比独立样本方法更接近名义水平，区间也更窄；而独立样本方法在应用医学文献中被频繁且错误地使用。<sup>[25](https://onlinelibrary.wiley.com/doi/10.1002/sim.4200)</sup> 风险差的配对方差估计为 \( \bigl((b+c) - (b-c)^{2}/n\bigr)/n^{2} \)，其中 \( b \) 和 \( c \) 为不一致对的计数，\( n \) 为配对数量。<sup>[25](https://onlinelibrary.wiley.com/doi/10.1002/sim.4200)</sup>

近期工作。有限维线性协变量调整未必能比未调整的均值差估计量提高精度，但为每个配对纳入固定效应则可以，且这是最优的有限维线性调整。<sup>[26](https://doi.org/10.1016/j.jeconom.2024.105740)</sup> 协变量自适应随机化推断（2024）修改置换概率，使其随集合内倾向评分差异而变化，而非假设匹配集合内分配均匀，从而在大样本下实现任意接近名义水平的第一类错误控制，且无需排除配对或对结局建模。<sup>[27](https://doi.org/10.1093/jrsssb/qkae033)</sup>

## 局限与替代方案

样本损失与估计目标变化。丢弃未匹配的观测会减少样本量并可能增大方差，从而掩盖真实的组间差异。<sup>[28](https://pmc.ncbi.nlm.nih.gov/articles/PMC4756459/)</sup> 卡钳匹配可有效消除不平衡，但当需要推断至特定目标人群时，会因匹配不完全而引入偏倚。<sup>[5](https://cran.r-project.org/web/packages/MatchIt/vignettes/matching-methods.html)</sup>

残余混杂与分析误差。将匹配与回归结合可能抬高第一类错误；在结局模型中将倾向评分作为协变量纳入可弥补这一点。<sup>[28](https://pmc.ncbi.nlm.nih.gov/articles/PMC4756459/)</sup> 匹配后应用的分层 Cox 模型可能功效偏低，尤其在 1:1 比例下，在 1:4 等比例下有所改善；对整个队列进行 Cox 回归通常对检测处理效应更有功效。<sup>[28](https://pmc.ncbi.nlm.nih.gov/articles/PMC4756459/)</sup>

与回归的比较。根据已发表模拟提出的经验法则：当 OLS 与匹配的点估计相近时，OLS 推断更常无偏；当二者不同时，匹配推断更常无偏。<sup>[29](https://pmc.ncbi.nlm.nih.gov/articles/PMC6601529/)</sup> 除非纳入非线性项或适当的交互项，匹配与加权均不能防止模型设定错误导致的偏倚；若倾向评分模型设定错误，逆概率加权将无法达到所需的平衡。<sup>[30](https://researchonline.lshtm.ac.uk/id/eprint/4677062/1/Keele-Grieve-2025-So-many-choices-a-guide.pdf)</sup> 自助法（bootstrap）一般而言对匹配估计量无效。<sup>[31](https://doi.org/10.3982/ecta11293)</sup>

## References

1. [Yuehao Bai, Joseph P. Romano, Azeem M. Shaikh (2022). Inference in Experiments with Matched Pairs. .](https://doi.org/10.1920/wp.cem.2019.1919)
2. [Elizabeth A. Stuart (2010). Matching Methods for Causal Inference: A Review and a Look Forward. Statistical Science.](https://doi.org/10.1214/09-sts313)
3. [Optimality of Matched-Pair Designs in Randomized Controlled Trials (Yale working paper)](https://economics.yale.edu/sites/default/files/optdesign.pdf)
4. [Quinn McNemar (1947). Note on the Sampling Error of the Difference Between Correlated Proportions or Percentages. Psychometrika.](https://doi.org/10.1007/bf02295996)
5. [Matching Methods (MatchIt vignette)](https://cran.r-project.org/web/packages/MatchIt/vignettes/matching-methods.html)
6. [Chapter 10: Matched/Dependent Observations (applied categorical data analysis textbook)](https://profjhklopper.quarto.pub/chapter-10/)
7. [PAUL R. ROSENBAUM, DONALD B. RUBIN (1983). The central role of the propensity score in observational studies for causal effects. Biometrika.](https://doi.org/10.1093/biomet/70.1.41)
8. [Matching (University of Zurich EBPI lecture notes, June 13, 2025)](https://ebpi.uzh.ch/dam/jcr:2d12b436-60af-44a4-a071-82d3d2935a99/Matching_13_06_25.pdf)
9. [Modern Algorithms for Matching in Observational Studies (Annual Review of Statistics and Its Application)](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-031219-041058)
10. [Peter C. Austin (2009). Using the Standardized Difference to Compare the Prevalence of a Binary Variable Between Two Groups in Observational Research. Communications in Statistics - Simulation and Computation.](https://doi.org/10.1080/03610910902859574)
11. [William G. Cochran (1953). Matching in Analytical Studies. American Journal of Public Health and the Nations Health.](https://doi.org/10.2105/ajph.43.6_pt_1.684)
12. [W. Z. Billewicz (1965). The Efficiency of Matched Samples: An Empirical Investigation. Biometrics.](https://doi.org/10.2307/2528546)
13. [Donald B. Rubin (1976). Multivariate Matching Methods That are Equal Percent Bias Reducing, I: Some Examples. Biometrics.](https://doi.org/10.2307/2529342)
14. [Fisher's randomization test and Darwin's data – A footnote to the history of statistics (Jacquez & Jacquez, Mathematical Biosciences, 2002)](https://www.sciencedirect.com/science/article/abs/pii/S0025556402001232)
15. [Kosuke Imai (2008). Variance identification and efficiency analysis in randomized experiments under the matched‐pair design. Statistics in Medicine.](https://doi.org/10.1002/sim.3337)
16. [Paul R. Rosenbaum (1989). Optimal Matching for Observational Studies. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1989.10478868)
17. [Ben B Hansen (2004). Full Matching in an Observational Study of Coaching for the SAT. Journal of the American Statistical Association.](https://doi.org/10.1198/016214504000000647)
18. [John E. Connett, Judith A. Smith, Richard B. McHugh (1987). Sample size and power for pair‐matched case‐control studies. Statistics in Medicine.](https://doi.org/10.1002/sim.4780060107)
19. [Samy Suissa, Jonathan J. Shuster (1991). The 2 x 2 Matched-Pairs Trial: Exact Unconditional Design and Analysis. Biometrics.](https://doi.org/10.2307/2532131)
20. [Paul W. Mielke, Kenneth J. Berry (1976). An Extended Class of Matched Pairs Tests based on Powers of Ranks. Psychometrika.](https://doi.org/10.1007/bf02291700)
21. [Stefano M. Iacus, Gary King, Giuseppe Porro (2011). Causal Inference without Balance Checking: Coarsened Exact Matching. Political Analysis.](https://doi.org/10.1093/pan/mpr013)
22. [Alexis Diamond, Jasjeet S. Sekhon (2012). Genetic Matching for Estimating Causal Effects: A General Multivariate Matching Method for Achieving Balance in Observational Studies. The Review of Economics and Statistics.](https://doi.org/10.1162/rest_a_00318)
23. [Giancarlo Visconti, José R. Zubizarreta (2018). Handling Limited Overlap in Observational Studies with Cardinality Matching. Observational Studies.](https://doi.org/10.1353/obs.2018.0012)
24. [Samuel D. Pimentel and colleagues (2015). Large, Sparse Optimal Matching With Refined Covariate Balance in an Observational Study of the Health Outcomes Produced by New Surgeons. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.2014.997879)
25. [Comparing paired vs non-paired statistical methods of analyses in propensity-score matched samples (Austin, Statistics in Medicine 2011)](https://onlinelibrary.wiley.com/doi/10.1002/sim.4200)
26. [Yuehao Bai and colleagues (2024). Covariate adjustment in experiments with matched pairs. Journal of Econometrics.](https://doi.org/10.1016/j.jeconom.2024.105740)
27. [Samuel D Pimentel, Yaxuan Huang (2024). Covariate-adaptive randomization inference in matched designs. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1093/jrsssb/qkae033)
28. [Observational Studies: Matching or Regression?](https://pmc.ncbi.nlm.nih.gov/articles/PMC4756459/)
29. [Performance of Matching Methods as Compared With Unmatched Ordinary Least Squares Regression Under Constant Effects (American Journal of Epidemiology)](https://pmc.ncbi.nlm.nih.gov/articles/PMC6601529/)
30. [So Many Choices: A Guide to Selecting Among Methods to Adjust for Observed Confounders (Keele & Grieve, 2025)](https://researchonline.lshtm.ac.uk/id/eprint/4677062/1/Keele-Grieve-2025-So-many-choices-a-guide.pdf)
31. [Alberto Abadie, Guido W. Imbens (2016). Matching on the Estimated Propensity Score. Econometrica.](https://doi.org/10.3982/ecta11293)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/matched-pair-analysis

English original: https://www.edgepedia.org/matched-pair-analysis
