FH03 · REFERENCE SHEET

方差分析公式总表 ANOVA Formula Sheet

把总变异拆成组间“信号”和组内“噪声”,再用 F 比值判断信号是否超过噪声。自上而下重要度递减:先会分解,再会扩展到交互、多重比较与随机效应。 Split total variation into between-group signal and within-group noise, then ask whether the F ratio clears the noise floor. Importance drops down the page: master the decomposition first, then extend it to interactions, multiple comparisons, and random effects.

核心比值Core ratio
F = MSB/MSW
信号 ÷ 噪声signal ÷ noise
T1

必背 · 从变异分解到 F 检验 Memorize · From Variation Decomposition to the F Test

4 张核心卡 4 core cards
T1-1

总变异分解 Total Variation Decomposition

F18 深潜 → F18 deep dive →
SST = SSB + SSW

读作:总变异 = 组间信号 + 组内噪声。Read it as: Total variation equals between-group signal plus within-group noise.

  • SST 总平方和,总变异total sum of squares, all variation
  • SSB 组间平方和,即“信号”between-group sum of squares, the signal
  • SSW 组内平方和,即“噪声”within-group sum of squares, the noise
何时用:Use it when: 建立单因子 ANOVA 的基本账本,确认总变异被完整拆分。 You are building the one-way ANOVA accounting identity and need every unit of variation assigned.
✗ 把 SSB 大直接当成显著 → ✓ 先按自由度转成 MSB,再与 MSW 构成 F 比值。 ✗ Treat a large SSB as significance by itself → ✓ Convert it to MSB by degrees of freedom, then compare it with MSW through F.
T1-2

组间/组内平方和 Between- and Within-Group Sums of Squares

F18 深潜 → F18 deep dive →
SSB = Σ nj(jx̿)2
SSW = ΣΣ(xijj)2

读作:组均值偏离总均值的部分,加组内各点偏离组均值的部分。Read it as: Add the group means' departures from the grand mean and the observations' departures from their own group means.

nj每组人数加权Weight by the number of observations in each group (x̄j − x̿)2组均值离总均值的平方Squared distance from the group mean to the grand mean
  • nj 第 j 组样本量sample size in group j
  • j 第 j 组均值mean of group j
  • x̿ 全体数据的总均值grand mean across all observations
何时用:Use it when: 从原始分组数据计算组间信号和组内噪声。 You need to compute between-group signal and within-group noise directly from grouped observations.
✗ 在 SSB 中忽略组大小 nj → ✓ 每个组均值偏差都按该组样本量加权。 ✗ Omit nj from SSB → ✓ Weight each group-mean departure by that group's sample size.
T1-3

均方与自由度 Mean Squares and Degrees of Freedom

F18 深潜 → F18 deep dive →
MSB = SSB/(k−1)
MSW = SSW/(Nk)

读作:平方和摊到每个自由度上,才能公平比较。Read it as: Spread each sum of squares across its own degrees of freedom before comparing them fairly.

  • k 组数number of groups
  • N 总样本量total sample size
  • MSB / MSW 按各自自由度标准化后的方差估计variance estimates normalized by their own degrees of freedom
何时用:Use it when: 把平方和转成可比较的方差估计,为 F 比值做准备。 You need comparable variance estimates from sums of squares before forming the F ratio.
✗ 用总自由度 N − 1 同时除 SSB 和 SSW → ✓ 组间用 k − 1,组内用 N − k。 ✗ Divide both SSB and SSW by N − 1 → ✓ Use k − 1 between groups and N − k within groups.
F = MSB / MSW  ;  df = (k−1, N−k)

读作:信号方差除以噪声方差——比 1 大得越多越可疑。Read it as: Signal variance divided by noise variance—the farther above one, the more suspicious the group effect.

  • MSB 组间变异,即信号加噪声between-group variation, signal plus noise
  • MSW 组内变异,即噪声基线within-group variation, the noise baseline
  • F 大large F 组间差异超出组内噪声between-group differences rise above within-group noise
何时用:Use it when: 检验多个组的总体均值是否不全相等。 You need to test whether the population means of several groups are not all equal.
✗ F 检验显著就断言每两组都不同 → ✓ 只结论“至少一组不同”,再做 Tukey HSD 定位。 ✗ Read a significant F test as every pair being different → ✓ Conclude only that at least one mean differs, then locate pairs with Tukey HSD.
T2

常用 · 交互、效应量与前提 Working Set · Interactions, Effect Size, and Assumptions

3 张常用卡 3 working cards
T2-5

双因子含交互分解 Two-Factor Decomposition with Interaction

F57 深潜 → F57 deep dive →
SST = SSA + SSB + SSAB + SSE
df: a−1 / b−1 / (a−1)(b−1) / ab(n−1)
  • SSA, SSB 因子 A 与因子 B 的主效应平方和main-effect sums of squares for factors A and B
  • SSAB A×B 交互平方和sum of squares for the A×B interaction
  • SSE 误差平方和error sum of squares
何时用:Use it when: 同时研究两个因子,并判断一个因子的作用是否依赖另一个因子。 You are studying two factors and need to know whether one factor's effect depends on the other.
T2-6

效应量 Effect Size

F18 深潜 → F18 deep dive →
η2 = SSB/SST
ω2 = [SSB − (k−1)MSW] / (SST + MSW)
  • η2 样本中由组间差异解释的变异比例,偏乐观sample proportion of variation explained by groups; optimistically biased
  • ω2 对 η2 偏差进行校正的效应量bias-corrected alternative to η2
何时用:Use it when: 显著性之外还要回答“组别解释了多少变异”。 You must answer how much variation the grouping explains, not merely whether the F test is significant.
T2-7

方差齐性前提 Equal-Variance Assumption

F20 深潜 → F20 deep dive →
Levene(Median)  ·  Bartlett(Normal)
  • Levene 基于中位数时更稳健more robust when centered on group medians
  • Bartlett 对正态前提敏感powerful under normality but sensitive to departures from it
何时用:Use it when: 执行 ANOVA 前先检查各组方差是否可视为相等。 You need to check whether group variances can be treated as equal before running standard ANOVA.
T3

进阶 · 定位差异与建模变异 Advanced · Locate Differences and Model Variation

3 张进阶卡 3 advanced cards
T3-8

Tukey HSD 多重比较 Tukey HSD Multiple Comparisons

F58 深潜 → F58 deep dive →
HSD = qα,k,N−k · √(MSW/n)
|x̄i − x̄j| > HSD ⇒ p < α
  • qα,k,N−k 学生化极差分布临界值critical value from the studentized-range distribution
  • n 各组相等的样本量equal sample size per group
何时用:Use it when: 整体 ANOVA 显著后,在等样本设计中定位哪些均值对显著不同。 The omnibus ANOVA is significant and an equal-size design needs familywise-controlled pairwise comparisons.
T3-9

随机效应与 ICC Random Effects and ICC

F57 深潜 → F57 deep dive →
ICC = σ2between / (σ2between + σ2within)
  • σ2between 群组之间的方差分量between-cluster variance component
  • σ2within 群组内部的方差分量within-cluster variance component
何时用:Use it when: 把分组视为总体中的随机样本,并量化同组观测的相似程度。 Groups are sampled random effects and you need the share of variance attributable to clustering.
T3-10

ANOVA ≡ 回归 ANOVA Is Regression

F22 深潜 → F22 deep dive →
Y = Xcatβ + ε ⇔ ANOVA
Freg = FANOVA  ·  SSreg = SSANOVA
  • Xcat 用虚拟变量把分类水平写入回归设计矩阵dummy variables that place category levels in the regression design matrix
  • Freg / SSreg 两种表达得到同一 F 与同一平方和分解both formulations produce the same F statistic and sums-of-squares decomposition
何时用:Use it when: 需要把 ANOVA 扩展到协变量、不平衡设计或统一的线性模型框架。 You need to extend ANOVA to covariates, unbalanced designs, or one unified linear-model workflow.
相关教学页 Related teaching pages
38 · 单因子 ANOVA 38 · One-way ANOVA 39 · 双因子 ANOVA 39 · Two-way ANOVA
其他公式总表 Other formula sheets
FH01 流程能力 FH01 Capability FH02 假设检验 FH02 Hypothesis Testing FH03 方差分析 FH03 ANOVA FH04 回归 FH04 Regression FH05 DOE FH06 SPC FH07 MSA

方差分析公式总表