Mathwords logoMathwords

ANOVA — Definition, Formula & Examples

ANOVA (analysis of variance) is a hypothesis test that checks whether the means of three or more groups are all equal. It does this by comparing how spread out the group means are with how spread out the data are inside each group.

One-way ANOVA tests H0:μ1=μ2=⋯=μkH_0: \mu_1 = \mu_2 = \cdots = \mu_k against HaH_a: at least one μi\mu_i differs. The test statistic is F=MSG/MSEF = \text{MSG}/\text{MSE}. If H0H_0 is true, FF follows an F-distribution with k−1k-1 and N−kN-k degrees of freedom. The test assumes independent random samples, approximately normal populations, and equal population standard deviations.

Key Formula

F=MSGMSE=SSG/(k−1)SSE/(N−k),SSG=∑ni(xˉi−xˉ)2,SSE=∑(ni−1)si2F = \frac{\text{MSG}}{\text{MSE}} = \frac{\text{SSG}/(k-1)}{\text{SSE}/(N-k)}, \quad \text{SSG} = \sum n_i(\bar{x}_i - \bar{x})^2, \quad \text{SSE} = \sum (n_i - 1)s_i^2
Where:
  • kk = number of groups
  • NN = total number of observations across all groups
  • ni,xˉi,sin_i, \bar{x}_i, s_i = sample size, mean, and standard deviation of group i
  • xˉ\bar{x} = grand mean of all N observations
  • MSG\text{MSG} = mean square between groups (variation among group means)
  • MSE\text{MSE} = mean square error (variation within groups)

Worked Example

Problem: Three fertilizers are each tested on 3 plants. The growth values (cm) are A: 2, 3, 4; B: 4, 5, 6; C: 6, 7, 8. Test whether the mean growth is the same for all three fertilizers.
Step 1: Find each group mean and the grand mean. Here k=3k = 3 and N=9N = 9.
xˉA=3,xˉB=5,xˉC=7,xˉ=459=5\bar{x}_A = 3, \quad \bar{x}_B = 5, \quad \bar{x}_C = 7, \quad \bar{x} = \frac{45}{9} = 5
Step 2: Compute the between-group and within-group mean squares. Each group's squared deviations from its own mean sum to 1+0+1=21 + 0 + 1 = 2.
MSG=3[(3−5)2+(5−5)2+(7−5)2]2=242=12,MSE=2+2+26=66=1\text{MSG} = \frac{3[(3-5)^2 + (5-5)^2 + (7-5)^2]}{2} = \frac{24}{2} = 12, \quad \text{MSE} = \frac{2+2+2}{6} = \frac{6}{6} = 1
Step 3: Compute FF and find the p-value from the F-distribution with 2 and 6 degrees of freedom.
F=121=12,p=P(F2,6≥12)=0.008F = \frac{12}{1} = 12, \quad p = P(F_{2,6} \ge 12) = 0.008
Answer: F=12F = 12 with p-value =0.008= 0.008. At α=0.05\alpha = 0.05, reject H0H_0. There is convincing evidence that at least one fertilizer has a different mean growth.

Why It Matters

Running several two-sample t-tests on the same groups raises the chance of a false positive. ANOVA avoids this by testing all the means at once. It is not on the current AP Statistics exam outline, but it is standard in college statistics, psychology research, and agricultural and medical experiments.

Common Mistakes

Mistake: Concluding that all the group means are different after rejecting H0H_0.
Correction: A small p-value only tells you that at least one mean differs. To find which pairs differ, you need a follow-up procedure such as Tukey's method.

Related Terms