mindstair

Home / Courses / Statistics 2 / Unit 4

Statistics 2 Unit 4: One-Way ANOVA

One-way ANOVA compares the means of three or more groups with a single F test, avoiding the false positives of many t tests. You will build the ANOVA table, interpret F, check conditions and follow up with multiple comparisons.

Covers: Logic of analysis of variance, Sums of squares and the ANOVA table, The F statistic and its distribution, Conditions for ANOVA, Multiple comparisons (Tukey, Bonferroni), Effect size and the link to the t test

Study guide

Analysis of variance asks whether several population means are equal by comparing two kinds of variation. Between-group variation measures how far the group means sit from the grand mean. Within-group variation measures how much individual values scatter around their own group mean. If H₀: μ₁ = μ₂ = … = μ_k is true, group means should differ only about as much as random noise would make them. If group means are spread out far more than within-group noise predicts, we have evidence that at least one population mean differs. Running a single ANOVA avoids the inflated false-positive rate of many separate t tests.

The total sum of squares, SST = Σ(x − x̄)², splits exactly into SSG = Σnᵢ(x̄ᵢ − x̄)² for groups and SSE = Σ(nᵢ − 1)sᵢ² for error. Each is divided by its df to form a mean square: MSG = SSG/(k − 1) and MSE = SSE/(N − k). MSE is the pooled estimate of the common variance σ². The test statistic is F = MSG/MSE, which follows an F distribution with (k − 1, N − k) df when H₀ is true. Under H₀ both mean squares estimate σ², so F is near 1; large F values give small right-tail p-values.

ANOVA conditions are independent random samples or random assignment, approximately normal populations, and a common standard deviation. Check normality with dot plots or normal plots of residuals, and check equal spread with the rule that the largest sample SD should be less than about twice the smallest. ANOVA is fairly robust to mild non-normality and to unequal SDs when group sizes are similar, but unequal SDs combined with very unequal n can seriously distort the error rate. A residual spread that grows with the group mean often responds to a log transformation; otherwise use Welch's ANOVA.

A significant F tells you only that at least one mean differs. To find which, use multiple comparisons that control the familywise error rate. Bonferroni tests each of m comparisons at α/m and works for any set of comparisons, though it becomes conservative when m is large. Tukey's HSD is designed for all pairwise differences and is usually more powerful for that job. Pairwise t statistics use the pooled MSE: t = (x̄ᵢ − x̄ⱼ)/√(MSE(1/nᵢ + 1/nⱼ)). Because adjusted tests are conservative, a borderline F can be significant even when no single pair is.

Report effect size alongside the p-value. η² = SSG/SST (equal to R² in regression terms) gives the share of total variation explained by group membership. With only two groups, one-way ANOVA is identical to the pooled two-sample t test: F = t² with (1, N − 2) df and the same p-value. As always, the design decides the scope: random assignment to treatments supports causal claims, while comparing self-selected or naturally occurring groups shows only association. Do not go hunting through pairwise tests after a non-significant F; that is a recipe for false discoveries.

Key ideas

Formulas and rules

SSG = Σ nᵢ(x̄ᵢ − x̄)², df = k − 1; MSG = SSG/(k − 1)
SSE = Σ (nᵢ − 1)sᵢ², df = N − k; MSE = SSE/(N − k)
F = MSG/MSE with (k − 1, N − k) df
SST = SSG + SSE, df = N − 1
η² = SSG/SST
Bonferroni: test each of m comparisons at α/m; pairwise SE = √(MSE(1/nᵢ + 1/nⱼ))

Common mistakes

Before the test, make sure you can

Words to know

ANOVA
Analysis of variance; tests equality of several means by comparing variation between and within groups.
Factor
The categorical explanatory variable that defines the groups.
Grand mean
The mean of all N observations combined.
SSG
Sum of squares for groups: Σnᵢ(x̄ᵢ − x̄)², variation of group means around the grand mean.
SSE
Sum of squares for error: Σ(nᵢ − 1)sᵢ², variation within groups.
MSG
SSG/(k − 1), the between-group mean square.
MSE
SSE/(N − k), the pooled estimate of the common variance σ².
F statistic
MSG/MSE; compared with an F distribution with (k − 1, N − k) df.
F distribution
A right-skewed distribution of ratios of mean squares, indexed by numerator and denominator df.
Familywise error rate
The probability of at least one Type I error across a set of comparisons.
Bonferroni correction
Testing each of m comparisons at level α/m to keep the familywise rate at most α.
Tukey's HSD
A multiple-comparison method for all pairwise differences among group means.
η² (eta-squared)
SSG/SST, the proportion of total variation explained by the groups.
Welch's ANOVA
A version of one-way ANOVA that does not assume equal variances.
Residual
An observation minus its group mean; used to check ANOVA conditions.

Sample practice questions

30 more questions like these, from level 1 to 5, are in the practice set.

Question 1 (level 1)

One-way ANOVA tests the null hypothesis that:

  1. All k population means are equal
  2. All k sample means are equal
  3. All k population variances differ
  4. At least two population means are equal
Show the answer and steps

Answer: A) All k population means are equal

  1. H₀: μ₁ = μ₂ = … = μ_k.
  2. Hₐ: at least one mean differs from the others.
  3. Hypotheses concern population parameters, never sample means.
Question 2 (level 1)

In one-way ANOVA, the F statistic is the ratio:

  1. MSG/MSE, between-group over within-group mean square
  2. MSE/MSG, within-group over between-group mean square
  3. SSE/SSG, within-group over between-group sum of squares
  4. SST/SSE, total over within-group sum of squares
Show the answer and steps

Answer: A) MSG/MSE, between-group over within-group mean square

  1. MSG measures how far group means are from the grand mean.
  2. MSE measures typical spread inside groups.
  3. F = MSG/MSE; values near 1 are consistent with H₀.
Question 3 (level 3)

Three fertilizers are each tested on 10 plots. Mean yields are 20, 24 and 25 kg with SDs 4, 5 and 4.5 kg. What are F and the p-value?

  1. F = 0.25, p ≈ 0.78
  2. F = 3.43, p ≈ 0.012
  3. F = 6.86, p ≈ 0.004
  4. F = 3.43, p ≈ 0.047
Show the answer and steps

Answer: D) F = 3.43, p ≈ 0.047

  1. Grand mean = 23; SSG = 10(9 + 1 + 4) = 140; MSG = 70.
  2. SSE = 9(16 + 25 + 20.25) = 551.25; MSE = 551.25/27 = 20.42.
  3. F = 70/20.42 = 3.43 with (2, 27) df, p ≈ 0.047; 6.86 forgets to divide SSG by its df.