MATH 5010 · Sections 18–19

ANOVA: Comparing Several Means

An interactive teaching page for one-way ANOVA, F-tests, sums of squares, model assumptions, planned contrasts, post-ANOVA comparisons, and simulation-based intuition.

Big idea

ANOVA asks whether several population means can reasonably be treated as equal. Instead of doing many two-sample tests, ANOVA compares two sources of variability in one model.

Model: Y_ij = μ_i + ε_ij, ε_ij independent N(0, σ²)

F = MS_between / MS_within
Interpretation

If the group means are equal, the between-group mean square and within-group mean square estimate the same noise level. A large F statistic suggests the group means are separated more than random noise would explain.

Learning goals

  • Compute a one-way ANOVA table from raw data.
  • Explain SST = SSB + SSW.
  • Use the F distribution for the global test.
  • Check assumptions: independence, normal errors, equal variance.
  • Use planned contrasts and pairwise comparisons carefully.

Notation map

Groups
i = 1, …, k
Observations
Y_ij, j = 1, …, n_i
Group means
Ȳ_i.
Grand mean
Ȳ_..

1. Interactive one-way ANOVA table

Enter one group per line. The default trout-toxin data match the ANOVA treatment example from the course lab.

F
p-value
η²
Decision
Hypotheses for one-way ANOVA

H0: μ1 = μ2 = ⋯ = μk.    HA: at least one μi differs.

The ANOVA F-test is global. Rejecting H0 tells us that not all means are equal, but it does not by itself identify which means differ.

2. Decomposing variation

The identity behind one-way ANOVA is:

SST = SSB + SSW

Use the current data and choose a group to visualize deviations from the grand mean, group mean, and observation.

3. Simulate F statistics

When δ = 0, all group means are equal and the rejection rate should be close to α = 0.05. Increase δ to see power rise.

4. Assumption explorer

ANOVA is most reliable when errors are independent, roughly normal within groups, and groups have similar variances. Explore how unequal variance changes group spread.

5. Planned linear contrast

A planned contrast tests a focused comparison, such as one treatment versus the average of two controls.

L = a1 μ1 + ⋯ + ak μk, with a1 + ⋯ + ak = 0
Test statistic

T = L̂ / sqrt(MSE Σ a_i²/n_i), with df = N − k.

Reject a two-sided contrast test when |T| is larger than the corresponding t critical value.

6. Pairwise comparisons from current data

After a significant global ANOVA, pairwise comparisons help locate differences. This table uses the pooled MSE from the current ANOVA and reports unadjusted and Bonferroni-adjusted p-values.

Teaching warning

Do not replace ANOVA by many unplanned t-tests.
As the number of groups grows, the number of pairwise tests grows quickly and the chance of at least one false positive increases. Use planned contrasts or a multiplicity adjustment when needed.
Number of pairs = k(k − 1)/2

Quick self-checks

1. Global null

What is H0 in one-way ANOVA?

2. Large F

A large F statistic means:

3. After rejection

If ANOVA rejects H0, what do we know?