# 单因素方差分析

单因素方差分析（one-way ANOVA）是一种统计检验，用于判断三个或更多独立组的均值是否存在差异，这些组由一个因子的不同水平所界定。它比较各组均值围绕总均值的变异与每组内观测值的变异；两者之比若较大，则表明至少有一组的均值与其他组不同。<sup>[1](https://online.stat.psu.edu/stat500/Lesson10)</sup>

| 关键事实 | 详情 |
|---|---|
| 目的 | 检验 k 个独立组的均值是否全部相等，每组为一个分类因子的一个水平<sup>[2](https://stats.libretexts.org/Courses/Lake_Tahoe_Community_College/Introductory_Statistics_%28OpenStax%29_With_Multimedia_and_Interactivity/13%3A_F_Distribution_and_One-Way_ANOVA/13.02%3A_One-Way_ANOVA)</sup> |
| 检验统计量 | \( F = \mathrm{MS}_{\text{between}} / \mathrm{MS}_{\text{within}} \)；在原假设下，两个均方估计的是同一个误差方差，因此 F 接近于 1<sup>[1](https://online.stat.psu.edu/stat500/Lesson10)</sup> |
| 假设 | \( H_0: \mu_1 = \mu_2 = \cdots = \mu_k \)，对立假设 \( H_a \)：并非所有均值都相等<sup>[2](https://stats.libretexts.org/Courses/Lake_Tahoe_Community_College/Introductory_Statistics_%28OpenStax%29_With_Multimedia_and_Interactivity/13%3A_F_Distribution_and_One-Way_ANOVA/13.02%3A_One-Way_ANOVA)</sup> |
| 自由度 | 因子（处理）：\( k-1 \)；误差：\( n-k \)；总计：\( n-1 \)<sup>[3](https://openbooks.macewan.ca/introstats/chapter/12-4-one-way-anova-f-test/)</sup> |
| 核心假定 | 总体正态、各组方差相等、随机样本相互独立<sup>[3](https://openbooks.macewan.ca/introstats/chapter/12-4-one-way-anova-f-test/)</sup> |
| 方差不等的替代方法 | 韦尔奇（Welch，1951）近似检验；在 1996 年的一项元分析中，詹姆斯二阶检验与韦尔奇检验在方差非齐性条件下表现最佳<sup>[4](https://academic.oup.com/biomet/article-abstract/38/3-4/330/257875)</sup><sup> • </sup><sup>[5](https://journals.sagepub.com/doi/10.3102/00346543066004579)</sup> |
| 非参数对应方法 | 克鲁斯卡尔-沃利斯检验（Kruskal-Wallis test），比较平均秩而非均值，且不假定正态性<sup>[6](https://www.mathworks.com/help/stats/kruskalwallis.html)</sup> |

## 检验的作用

单因素布局由一个因子及其若干水平和每个水平上的多次观测构成。模型将每个观测值写成总均值、水平效应与随机误差之和：\( Y_{ij} = \mu + \tau_i + \epsilon_{ij} \)，其中 \( Y_{ij} \) 是第 \( i \) 个处理水平上的第 \( j \) 个观测值，\( \mu \) 是整个实验的共同效应，\( \tau_i \) 是第 \( i \) 个处理效应，\( \epsilon_{ij} \) 是随机误差。在固定效应模型中，各水平是固定的，误差服从均值为零、方差恒定的正态独立分布；在随机效应模型中，各水平是从可能水平总体中抽取的随机样本，\( \tau_i \) 是随机变量。<sup>[7](https://itl.nist.gov/div898/handbook/prc/section4/prc432.htm)</sup>

数据中的总变异分解为两个部分：处理平方和与误差平方和。将每个平方和除以其自由度，得到均方。若不存在水平效应，组间均方与组内（残差）均方是同一总体方差的两个估计，数值上应当接近；若存在水平效应，水平均方将大于残差均方。<sup>[8](https://itl.nist.gov/div898/handbook/ppc/section2/ppc231.htm)</sup> 检验统计量是两者之比，

\[ F_0 = \frac{\mathrm{MS}_{\text{treatment}}}{\mathrm{MS}_{\text{error}}}, \]

在模型假定下，它服从自由度为 \( k-1 \) 和 \( n-k \) 的 F 分布。若 \( F_0 \) 大于所选显著性水平下的表列临界值，则表明存在水平效应。<sup>[8](https://itl.nist.gov/div898/handbook/ppc/section2/ppc231.htm)</sup>

## 假定

教科书对所需条件的表述措辞略有不同，但实质一致。麦科文（MacEwan）应用统计学教材列出：总体正态、方差相等、样本独立，以及从 k 个总体中抽取简单随机样本。<sup>[3](https://openbooks.macewan.ca/introstats/chapter/12-4-one-way-anova-f-test/)</sup> 基于 OpenStax 的论述补充说，因子是分类变量，响应变量是数值变量。<sup>[2](https://stats.libretexts.org/Courses/Lake_Tahoe_Community_College/Introductory_Statistics_%28OpenStax%29_With_Multimedia_and_Interactivity/13%3A_F_Distribution_and_One-Way_ANOVA/13.02%3A_One-Way_ANOVA)</sup> 关于等方差条件，一个常用的经验规则是：若最大样本标准差除以最小样本标准差不大于二，则可认为总体方差相等。<sup>[9](https://online.stat.psu.edu/stat200/Lesson10)</sup>

稳健性取决于设计的平衡性。平衡情形（每组观测数相等）已知对处理方差不相等具有一定稳健性；一个常用的经验法则是，当最大处理方差与最小处理方差之比小于 2 时，方差分析仍保持稳健。非平衡情形对等方差假定更为敏感，当各组样本量不等且假定被违反时，总体 F 检验的 p 值不可信。<sup>[10](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/onewayan.htm)</sup><sup> • </sup><sup>[11](https://libguides.library.kent.edu/spss/onewayanova)</sup> 一项对稳健性文献的定量综述得出结论：在教育与心理数据中，方差非齐性和非正态性常常会使单因素独立组设计中的 F 检验失效。<sup>[5](https://journals.sagepub.com/doi/10.3102/00346543066004579)</sup>

## 实施检验

标准程序有六个步骤：陈述假设 \( H_0: \mu_1 = \mu_2 = \cdots = \mu_k \) 与 \( H_a \)：并非所有均值都相等；选择显著性水平 \( \alpha \)；计算平方和与均方并编制方差分析表；在自由度为 \( k-1 \) 和 \( n-k \) 的 F 曲线下求 p 值 \( P(F \geq F_0) \) 或拒绝域；若 p 值不大于 \( \alpha \) 或 \( F_0 \) 落入拒绝域，则拒绝 \( H_0 \)；最后陈述结论。<sup>[3](https://openbooks.macewan.ca/introstats/chapter/12-4-one-way-anova-f-test/)</sup>

NIST/SEMATECH 手册中的一个计算实例可以说明这些数字的量级。五台机器制造同一零件，每台各抽样五次测量销直径。方差分析表给出因子平方和为 0.000137，自由度为 4（均方 0.000034）；残差平方和为 0.000132，自由度为 20（均方 0.000007），因此 \( F_0 = 4.86 \)。这超过了自由度为 4 和 20 的 F 分布在 0.05 水平下的临界值 2.87，因此数据表明各机器所制销直径存在统计学上的显著差异。<sup>[8](https://itl.nist.gov/div898/handbook/ppc/section2/ppc231.htm)</sup>

## 与 t 检验及多重比较的关系

只有两组时，单因素方差分析与合并方差的独立样本 t 检验结果相同。<sup>[9](https://online.stat.psu.edu/stat200/Lesson10)</sup><sup> • </sup><sup>[11](https://libguides.library.kent.edu/spss/onewayanova)</sup> 在两组以上时，之所以宁愿用方差分析而不用多次两两 t 检验，原因在于第一类错误率：进行多次检验会抬高整个检验族中出现至少一次假阳性的概率，而单一的总体 F 检验可以避免这一点。<sup>[9](https://online.stat.psu.edu/stat200/Lesson10)</sup>

显著的 F 检验只说明至少有一个均值不同，并不指出哪些组不同。图基诚实显著性差异检验（Tukey's Honestly Significant Difference test）等后续事后程序在进行所有两两比较的同时，针对检验次数进行调整，使第一类错误率不被抬高。<sup>[9](https://online.stat.psu.edu/stat200/Lesson10)</sup> 总体检验与两两程序之间的关系并不完全一致：即使在独立性、正态性和方差齐性条件下，对于 \( k > 2 \) 组、在同一显著性水平下，单因素方差分析 F 检验与图基-克莱默（Tukey-Kramer）多重比较检验也可能得出相反结论，一个拒绝而另一个不拒绝。<sup>[12](https://arxiv.org/abs/2104.07552)</sup>

## 假定不满足时的替代方法

当方差不相等时，经典 F 检验可以用专为异方差性设计的检验替代。利兹大学的 B. L. 韦尔奇（B. L. Welch）在 1951 年《生物计量学》（Biometrika）上发表的论文《关于若干均值比较：一种替代方法》（第 38 卷，第 330 至 336 页）中提出了一种近似检验；詹姆斯（James，1951）以及布朗（Brown）与福赛斯（Forsythe，1974）提出了相关的二阶检验和修正 F 检验。<sup>[4](https://academic.oup.com/biomet/article-abstract/38/3-4/330/257875)</sup><sup> • </sup><sup>[13](https://www.sciencedirect.com/science/article/abs/pii/S0167947310004779)</sup> 在 1996 年对稳健性研究的元分析综述中，詹姆斯二阶程序与韦尔奇程序在方差不相等时表现最强，但它们对某些非正态分布的敏感性可能使它们在某些情境下不适用。<sup>[5](https://journals.sagepub.com/doi/10.3102/00346543066004579)</sup> 后来的工作将韦尔奇方法推广到异方差下单因素模型的稳健位置与尺度度量。<sup>[14](https://www.sciencedirect.com/science/article/pii/S0378375806000577)</sup>

当正态性存疑时，克鲁斯卡尔-沃利斯检验是单因素方差分析的非参数对应方法：它将每个观测值转换为合并样本中的秩，并比较组间的平均秩，假定所有样本来自除可能的位置漂移外具有相同连续分布的总体，而经典单因素方差分析则假定总体正态。<sup>[6](https://www.mathworks.com/help/stats/kruskalwallis.html)</sup>

## 历史

方差分析由数学家兼遗传学家 R. A. 费希尔（R. A. Fisher）于 20 世纪 20 年代在罗瑟姆斯特德实验站（Rothamsted Experimental Station）任统计师期间发展起来，他的方法重塑了该站的农业研究。他对该理论最早的初步讨论见于 1923 年发表的一篇论文，随后在 1925 年的著作《研究工作者的统计方法》（*Statistical Methods for Research Workers*）中作了更完整的阐述。<sup>[15](https://era.ed.ac.uk/items/ce105974-1a8d-4b86-83dc-a0bc9ca4a97b)</sup> 费希尔将方差分析描述为“一种排列算术事实的简单方法，以便以最大的简洁性分离并展示一组数据的本质特征”；统计学家罗杰·米德（Roger Mead）称它大概是罗瑟姆斯特德在统计学意义上最重要的产物，因为它是大多数科学家日常使用的工具。<sup>[16](https://academic.oup.com/jrssig/article/15/3/14/7029388)</sup> 费希尔的统计方法并未局限于农业；到 20 世纪 50 年代末，它们已被心理学、社会学、教育学、化学、医学、工程学、经济学和质量控制等学科采用。<sup>[17](https://documentsdelivered.com/source/038/197/038197773.php)</sup>

## References

1. [Lesson 10: Introduction to ANOVA, STAT 500, Penn State Eberly College of Science](https://online.stat.psu.edu/stat500/Lesson10)
2. [13.2: One-Way ANOVA, Introductory Statistics (OpenStax) via LibreTexts](https://stats.libretexts.org/Courses/Lake_Tahoe_Community_College/Introductory_Statistics_%28OpenStax%29_With_Multimedia_and_Interactivity/13%3A_F_Distribution_and_One-Way_ANOVA/13.02%3A_One-Way_ANOVA)
3. [12.4 One-Way ANOVA F Test, Introduction to Applied Statistics, MacEwan University](https://openbooks.macewan.ca/introstats/chapter/12-4-one-way-anova-f-test/)
4. [B. L. Welch (1951). On the comparison of several mean values: an alternative approach. Biometrika 38(3-4), 330-336.](https://academic.oup.com/biomet/article-abstract/38/3-4/330/257875)
5. [Lix, L. M., Keselman, J. C., Keselman, H. J. (1996). Consequences of Assumption Violations Revisited: A Quantitative Review of Alternatives to the One-Way Analysis of Variance F Test. Review of Educational Research 66(4).](https://journals.sagepub.com/doi/10.3102/00346543066004579)
6. [kruskalwallis - Kruskal-Wallis test, MATLAB documentation, MathWorks](https://www.mathworks.com/help/stats/kruskalwallis.html)
7. [7.4.3.2. The one-way ANOVA model and assumptions, NIST/SEMATECH e-Handbook](https://itl.nist.gov/div898/handbook/prc/section4/prc432.htm)
8. [3.2.3.1. One-Way ANOVA, NIST/SEMATECH e-Handbook](https://itl.nist.gov/div898/handbook/ppc/section2/ppc231.htm)
9. [Lesson 10: One-Way ANOVA, STAT 200, Penn State Eberly College of Science](https://online.stat.psu.edu/stat200/Lesson10)
10. [ONE WAY ANOVA command, Dataplot Reference Manual, NIST](https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/onewayan.htm)
11. [One-Way ANOVA, SPSS Tutorials, Kent State University Libraries](https://libguides.library.kent.edu/spss/onewayanova)
12. [Logical contradictions in the One-way ANOVA and Tukey-Kramer multiple comparisons tests with more than two groups of observations, arXiv:2104.07552](https://arxiv.org/abs/2104.07552)
13. [Comparison of several means: A fiducial based approach, Computational Statistics & Data Analysis](https://www.sciencedirect.com/science/article/abs/pii/S0167947310004779)
14. [Kulinskaya, E., Dollinger, M. B. (2007). Robust weighted one-way ANOVA: Improved approximation and efficiency. Journal of Statistical Planning and Inference 137(2), 462-472.](https://www.sciencedirect.com/science/article/pii/S0378375806000577)
15. [Basic theorems of analysis of variance with special reference to field experiments, University of Edinburgh thesis record](https://era.ed.ac.uk/items/ce105974-1a8d-4b86-83dc-a0bc9ca4a97b)
16. [Where the Seeds of Modern Statistics were Sown, Significance (Royal Statistical Society)](https://academic.oup.com/jrssig/article/15/3/14/7029388)
17. [Parolini, G. (2014). The Emergence of Modern Statistics in Agricultural Science: Analysis of Variance, Experimental Design and the Reshaping of Research at Rothamsted Experimental Station, 1919-1933. Journal of the History of Biology 48(2), 301-335.](https://documentsdelivered.com/source/038/197/038197773.php)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: 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/one-way-analysis-of-variance

English original: https://www.edgepedia.org/one-way-analysis-of-variance
