# 交互作用检验（统计学）

交互作用检验（interaction testing）是一组统计程序，用来判定一个变量对某一结果的影响是否取决于另一个变量的取值水平。在回归中，这一检验围绕两个预测变量之间的乘积项构建；在流行病学中，同一个问题被称为效应修饰（effect modification），而乘积项系数在统计上显著，意味着在模型连接函数的尺度上存在交互作用，因此只有在恒等连接模型中，它检验的才是结果尺度上对可加性的偏离。<sup>[1](http://faculty.washington.edu/tathornt/SISG2021/lectures/SISG2021session07.pdf)</sup> 这一检验相对于两个主效应检验所多出来的，是对简单效应的比较：交互作用的大小，由一个因素的效应在另一个因素各水平间的变化幅度来度量。<sup>[2](https://www.stat.vt.edu/content/dam/stat_vt_edu/graphics-and-pdfs/research-papers/Technical_Reports/TechReport04-6.pdf)</sup> 两个主效应可以都不为零，而其中一个变量的效应在另一个变量的每一个水平上都完全相同；只有交互作用检验才能把这种情况与效应确实随水平而变化的情况区分开来。

| 关键事实 | 数值 |
|---|---|
| 二因素线性交互作用模型 | \( Y = b_{0} + b_{1} \cdot X + b_{2} \cdot Z + b_{3}(X \cdot Z) + e \)<sup>[3](https://www.quantpsy.org/interact/interactions.htm)</sup> |
| 原假设 | \( H_{0}: b_{3} = 0 \)（等价地，在亚组记号下为 \( \delta = 0 \)）<sup>[1](http://faculty.washington.edu/tathornt/SISG2021/lectures/SISG2021session07.pdf)</sup><sup> • </sup><sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC3193873/)</sup> |
| \( b_{3} \) 的含义 | 当 Z 增加一个单位时，Y 对 X 的斜率的变化量<sup>[3](https://www.quantpsy.org/interact/interactions.htm)</sup> |
| 简单斜率检验 | 自由度为 \( N - k - 1 \) 的 t 检验<sup>[3](https://www.quantpsy.org/interact/interactions.htm)</sup> |
| 检出典型交互作用的中位统计功效（心理学元研究，159 项研究） | .18<sup>[5](https://journals.sagepub.com/doi/10.1177/25152459231178728)</sup> |
| 在功效 .80 下检出 \( d = 0.175 \) 所需样本量 | \( N = 1{,}024 \)，是对应主效应的四倍<sup>[5](https://journals.sagepub.com/doi/10.1177/25152459231178728)</sup> |
| 在 \( \alpha = .05 \) 下做 10 次独立交互作用检验的假阳性风险 | 超过 40%<sup>[6](https://www.nejm.org/doi/full/10.1056/NEJMsr077003)</sup> |

## 工作原理

在多元线性回归中，二因素交互作用模型为 \( Y = b_{0} + b_{1} \cdot X + b_{2} \cdot Z + b_{3}(X \cdot Z) + e \)，其中最后一项是两个预测变量的乘积。<sup>[3](https://www.quantpsy.org/interact/interactions.htm)</sup> 同一模型可以改写为 \( \hat{Y} = b_{0} + (b_{1} + b_{3} \cdot M) \cdot X + b_{2} \cdot M \)，这表明 X 对 Y 的效应是条件量 \( b_{1} + b_{3} \cdot M \)；若 \( b_{3} \) 为零，则 X 的效应不依赖于 M。<sup>[7](https://www.akmontoya.com/_files/ugd/0a182f_460be8a78cff4709a4045cb2a8a123df.pdf)</sup> 因此，调节检验就是检验 \( H_{0}: b_{3} = 0 \)，并对两个低阶项一并加以控制。<sup>[8](https://uopsych.github.io/psy612/readings/McClelland-1993-Psychol%20Bull.pdf)</sup>

存在两种等价的表述。把乘积项系数与零比较，以及把乘积项加入含 X 与 M 的模型后检验 \( R^{2} \) 的变化，在数学上是同一个检验；\( R^{2} \) 的显著增加即为调节存在的肯定性证据。<sup>[7](https://www.akmontoya.com/_files/ugd/0a182f_460be8a78cff4709a4045cb2a8a123df.pdf)</sup> 在模型中同时含 X 与 Z 的乘积项检验，也与采用 −1 与 +1 对比编码的 2 × 2 方差分析中的交互作用检验在统计上完全相同，因此实验中的交互作用与调节，是同一个量在不同设计下的两种看法。<sup>[8](https://uopsych.github.io/psy612/readings/McClelland-1993-Psychol%20Bull.pdf)</sup> 在流行病学中，同样的结构表现为把 y 对 G、E 及其乘积做回归，并用任意自由度为 1 的检验来检验 \( H_{0}: \beta_{ix} = 0 \)。<sup>[1](http://faculty.washington.edu/tathornt/SISG2021/lectures/SISG2021session07.pdf)</sup>

## 操作步骤

对于连续预测变量，在构造乘积之前先从每个变量中减去样本均值：\( X_{c} = X - \mathrm{mean}(X) \)、\( W_{c} = W - \mathrm{mean}(W) \)，乘积由中心化后的版本构造，绝不要对已经相乘的原始乘积再做中心化。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup> 两个低阶项无论自身是否显著都保留在模型中；删去不显著的主效应，会破坏交互作用的解释所依赖的层级结构。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup> 中心化之后，\( b_{1} \) 是 W 取其均值时 X 的简单效应；对于这个 W 以其样本均值中心化的线性模型，\( b_{1} \) 也等于 X 在观测到的各 W 值上的平均条件斜率——这一区别在输出结果中常被误读。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup>

\( b_{3} \) 显著只能确定 X–Y 斜率在 W 的不同水平上存在差异，却说不清斜率在何处为正、为负或为零；这需要进一步探查。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup> 两种成熟的探查方法是简单斜率与约翰逊–尼曼法。<sup>[10](https://www.quantpsy.org/pubs/preacher_curran_bauer_2006.pdf)</sup> 简单斜率以 t 检验来检验，t 等于斜率除以其标准误，自由度为 \( N - k - 1 \)，其中 k 计入包括交互项在内的预测变量个数。<sup>[3](https://www.quantpsy.org/interact/interactions.htm)</sup> 约翰逊–尼曼法则从临界比值反推，找出使简单斜率恰好达到显著的调节变量取值，从而界定显著性区域；它相对于简单斜率的优点在于，后者所选取的调节变量取值终究是任意的。<sup>[10](https://www.quantpsy.org/pubs/preacher_curran_bauer_2006.pdf)</sup> 报告时应给出 \( b_{3} \) 及其标准误、t 值或 z 值、置信区间，并给出 \( R^{2} \) 的变化量，因为 \( b_{3} \) 显著而 \( R^{2} \) 变化接近于零时，可能并无实际意义。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup>

## 起源

鲁本·M·巴伦（Reuben M. Baron）与戴维·A·肯尼（David A. Kenny）在 1986 年发表于《人格与社会心理学杂志》（*Journal of Personality and Social Psychology*）的论文中，引入了调节效应检验与中介效应检验之间的区分，这一区分塑造了此后交互作用分析与中介分析各自独立设计的格局。<sup>[11](https://doi.org/10.1037//0022-3514.51.6.1173)</sup>

## 变体

连续变量调节的回归方法通常称为调节多元回归（moderated multiple regression），在流行病学中同一个量被称为效应修饰。<sup>[12](https://oxfordre.com/business/display/10.1093/acrefore/9780190224851.001.0001/acrefore-9780190224851-e-236)</sup> 探查的变体包括简单斜率检验与显著性区域（约翰逊–尼曼程序，又称泛光分析）；其中许多做法部分依赖于可能产生误导的事后显著性检验。<sup>[12](https://oxfordre.com/business/display/10.1093/acrefore/9780190224851.001.0001/acrefore-9780190224851-e-236)</sup><sup> • </sup><sup>[13](https://urisohn.com/sohn_files/papers/JN2_2025.pdf)</sup>

交互项被纳入按响应类型（连续、二分类或至事件发生时间结局）选定的模型之中。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC3193873/)</sup> 在流行病学模型中，尺度至关重要：交互作用可以在加法尺度或乘法尺度上评估，二者与线性模型、对数线性模型和逻辑斯蒂模型的关系各不相同，文献还涵盖仅病例估计量以及两种尺度下的功效计算。<sup>[14](https://hsph.harvard.edu/wp-content/uploads/2024/10/InteractionTutorial_EM-1.pdf)</sup> 对于基因–环境交互作用，一种自由度为 2 的程序检验联合原假设 \( H_{0}: \beta_{G} = \beta_{G \times E} = 0 \)，把边际信号与交互信号结合起来，而不是单独检验乘积项。<sup>[15](https://pmc.ncbi.nlm.nih.gov/articles/PMC5859988/)</sup> 高维基因–环境方法被组织为基于检验、基于估计和基于预测三类框架。<sup>[16](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-112723-034315)</sup>

机器学习的扩展把交互作用检测视为针对已拟合黑箱模型的检验问题。交互差异（interaction difference, IAD）统计量把估计预测函数的方差与由偏依赖函数导出的无交互版本相比较，并嵌入一个无需重新拟合的双侧单样本 Z 检验之中。<sup>[17](https://www.mdpi.com/2504-4990/6/2/61)</sup> 约翰逊–尼曼 2.0 用广义可加模型代替线性回归来探查交互作用，产出 GAM 简单斜率图与 GAM 约翰逊–尼曼图。<sup>[13](https://urisohn.com/sohn_files/papers/JN2_2025.pdf)</sup>

## 应用

在随机临床试验中，治疗效应在某一基线变量各水平上的异质性，用治疗组与该变量之间的交互项来表达，而交互作用是否存在，取决于所用的治疗效应度量。<sup>[6](https://www.nejm.org/doi/full/10.1056/NEJMsr077003)</sup> 亚组分析通常从交互作用检验开始，在回归中建模为乘积项；用亚组记号表示，治疗效应在一个亚组中为 \( \beta \)，在另一亚组中为 \( \beta + \delta \)，因此形式上的检验是 \( H_{0}: \delta = 0 \)。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC3193873/)</sup>

## 局限与替代方案

交互作用比主效应难检出得多。对于与总体效应量级相同的交互作用，所需样本量要大到四倍；若交互作用小于总体效应的 20%，则至少要大到 100 倍。<sup>[18](https://pubmed.ncbi.nlm.nih.gov/11701102/)</sup> 在功效 .80 下检出 \( d = 0.175 \) 需要 \( N = 1{,}024 \)，是对应主效应样本量的四倍。<sup>[5](https://journals.sagepub.com/doi/10.1177/25152459231178728)</sup> 在模拟中，交互作用估计要到 \( n = 3{,}800 \) 才稳定；当 \( n \le 100 \) 时，有 11% 至 45% 的估计符号错误，而多数心理学研究的受试者人数远少于 500。<sup>[19](https://pubmed.ncbi.nlm.nih.gov/41815790)</sup>

多重性是第二种失效模式：在原假设下于 0.05 水平做 10 次独立交互作用检验，至少出现一次假阳性的机会超过 40%，因此需要更严格的标准。<sup>[6](https://www.nejm.org/doi/full/10.1056/NEJMsr077003)</sup> 一个常见错误是：分别在各亚组内检验治疗效应，据此宣称存在异质性，而不是直接检验交互作用本身。<sup>[6](https://www.nejm.org/doi/full/10.1056/NEJMsr077003)</sup> 与此一致，随机试验中的多数亚组分析未能为其主张提供基本的统计学支持。<sup>[20](https://jamanetwork.com/journals/jamainternalmedicine/fullarticle/2601419)</sup> 推荐的做法是把估计噪声与真实的异质性信号分开，并把估计之间的变异向零收缩，从而使置信区间变宽、p 值增大。<sup>[21](https://journals.sagepub.com/doi/full/10.1177/25152459241304347)</sup>

有两种长期流传的看法是错误的。均值中心化不改变交互作用的估计值、其精度或模型的 \( R^{2} \)，但乘积项引入的共线性仍可能影响模型稳定性与统计功效，因为预测变量之间的相关结构可能影响过拟合，并表现为统计功效下降。<sup>[22](https://link.springer.com/article/10.3758/s13428-025-02613-6)</sup> 拟合交互作用还要付出泛化代价：在存在真实协同交互作用且 \( N = 25 \) 时，简单效应模型在多达 47% 的模拟情形中泛化得更好；在不存在真实交互作用时，较简单的模型在多达 95% 的情形中泛化得更好；在探索性工作中，建议用交叉验证与自助法检查交互作用系数的稳定性。<sup>[22](https://link.springer.com/article/10.3758/s13428-025-02613-6)</sup> 最后，层级原则约束着解释：一旦检验了交互作用，两个低阶项就必须留在模型中，因为交互作用的含义依赖于这一结构。<sup>[9](https://casrai.org/guides/moderation-analysis-interaction-terms)</sup>

## References

1. [Lecture 7: Interaction Analysis (SISG 2021)](http://faculty.washington.edu/tathornt/SISG2021/lectures/SISG2021session07.pdf)
2. [Evaluating and Interpreting Interactions (Virginia Tech technical report)](https://www.stat.vt.edu/content/dam/stat_vt_edu/graphics-and-pdfs/research-papers/Technical_Reports/TechReport04-6.pdf)
3. [Interaction Effects in MLR, LCA, and MLM (Preacher, Curran & Bauer, quantpsy.org)](https://www.quantpsy.org/interact/interactions.htm)
4. [Detecting Moderator Effects Using Subgroup Analyses](https://pmc.ncbi.nlm.nih.gov/articles/PMC3193873/)
5. [How Many Participants Do I Need to Test an Interaction? Conducting an Appropriate Power Analysis and Achieving Sufficient Power to Detect an Interaction](https://journals.sagepub.com/doi/10.1177/25152459231178728)
6. [Statistics in Medicine, Reporting of Subgroup Analyses in Clinical Trials](https://www.nejm.org/doi/full/10.1056/NEJMsr077003)
7. [CMMinpress (moderation testing chapter, Montoya-hosted PDF)](https://www.akmontoya.com/_files/ugd/0a182f_460be8a78cff4709a4045cb2a8a123df.pdf)
8. [Detecting Moderator Effects: Further Views (Quantitative Methods in Psychology, Psychological Bulletin)](https://uopsych.github.io/psy612/readings/McClelland-1993-Psychol%20Bull.pdf)
9. [Moderation Analysis: Building and Interpreting an Interaction Term (CASRAI guide)](https://casrai.org/guides/moderation-analysis-interaction-terms)
10. [Computational Tools for Probing Interactions in Multiple Linear Regression, Multilevel Modeling, and Latent Curve Analysis (Preacher, Curran & Bauer, 2006)](https://www.quantpsy.org/pubs/preacher_curran_bauer_2006.pdf)
11. [Reuben M. Baron, David A. Kenny (1986). The moderator-mediator variable distinction in social psychological research: Conceptual, strategic, and statistical considerations.. Journal of Personality and Social Psychology.](https://doi.org/10.1037//0022-3514.51.6.1173)
12. [Testing and Interpreting Interaction Effects (Oxford Research Encyclopedia, Jeremy F. Dawson)](https://oxfordre.com/business/display/10.1093/acrefore/9780190224851.001.0001/acrefore-9780190224851-e-236)
13. [Johnson-Neyman 2.0: More Flexible, More Robust, and More Interpretable Probing of Interactions](https://urisohn.com/sohn_files/papers/JN2_2025.pdf)
14. [Interaction between the effects of exposures (tutorial, Epidemiologic Methods)](https://hsph.harvard.edu/wp-content/uploads/2024/10/InteractionTutorial_EM-1.pdf)
15. [Update on the State of the Science for Analytical Methods for Gene-Environment Interactions](https://pmc.ncbi.nlm.nih.gov/articles/PMC5859988/)
16. [High-Dimensional Gene–Environment Interaction Analysis](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-112723-034315)
17. [Interaction Difference Hypothesis Test for Prediction Models](https://www.mdpi.com/2504-4990/6/2/61)
18. [Subgroup analyses in randomised controlled trials: quantifying the risks of false-positives and false-negatives](https://pubmed.ncbi.nlm.nih.gov/11701102/)
19. [When Do Interaction/Moderation Effects Stabilize in Linear Regression?](https://pubmed.ncbi.nlm.nih.gov/41815790)
20. [Evaluation of Evidence of Statistical Support and Corroboration of Subgroup Claims in Randomized Clinical Trials (JAMA Internal Medicine)](https://jamanetwork.com/journals/jamainternalmedicine/fullarticle/2601419)
21. [How Not to Fool Ourselves About Heterogeneity of Treatment Effects (Advances in Methods and Practices in Psychological Science)](https://journals.sagepub.com/doi/full/10.1177/25152459241304347)
22. [To interact or not to interact: The pros and cons of including interactions in linear regression models](https://link.springer.com/article/10.3758/s13428-025-02613-6)

---
*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/interaction-testing-statistics

English original: https://www.edgepedia.org/interaction-testing-statistics
