Explanation

The F distribution

The F distribution is the distribution of a ratio of two independent sample variances (each divided by its own population variance) from normal populations. It is:

  • always positive and skewed to the right,
  • defined by two degrees of freedom: numerator df and denominator df (the order matters),
  • centred a little above 1; its shape can be mounded or exponential-looking depending on the df.

An F value near 1 says that the two variance estimates agree; a large F means the numerator estimate is much larger than the denominator one.

Test for two population variances

It compares the variability of two independent normal populations. H₀: σ₁² = σ₂² (the ratio equals 1). Test statistic F = s₁²/s₂², with df₁ = n₁ − 1 for the numerator and df₂ = n₂ − 1 for the denominator. For a right-tailed test put the larger sample variance in the numerator. For a two-tailed test at level α, take the larger variance on top and compare with the F value cutting off α/2 in the right tail. Assumptions: the two populations are normal and the samples are independent. The test is unreliable if normality fails, so check graphs first. It also serves as a check of the equal-variance assumption that ANOVA uses.

Why ANOVA?

To compare three or more population means you could run many two-sample t tests, but each test carries its own Type I risk, so the overall chance of at least one false rejection grows. One-way analysis of variance (ANOVA) tests all means at once with a single F test. "One-way" means there is one categorical explanatory variable (the factor, whose categories are the groups) and one numerical response.

Hypotheses and assumptions

  • H₀: μ₁ = μ₂ = … = μ_k. Hₐ: at least one mean is different from the others (not "all differ").
  • Assumptions: each population is normal, the populations have equal standard deviations (variances), and the samples are random and independent. They may have unequal sizes. The method is fairly robust when group sizes are similar.

How the F-ratio works

ANOVA compares two estimates of the common variance.

  • Variation between groups: how far the group means are from the overall (grand) mean. Sum of squares between SSB = Σ nᵢ(x̄ᵢ − x̄)², df = k − 1, mean square between MSB = SSB/(k − 1).
  • Variation within groups: how far the observations are from their own group mean. Sum of squares within SSW (also called error) = Σ(x − x̄ᵢ)², df = N − k, MSW = SSW/(N − k).
  • F = MSB/MSW, with numerator df = k − 1 and denominator df = N − k.

If H₀ is true, both mean squares estimate the same variance, so F should be near 1 (small F, large p-value). If the group means really differ, MSB is inflated and F is large (small p-value). The test is always right-tailed. Results are summarised in an ANOVA table (source, SS, df, MS, F, p-value). The total sum of squares SST = SSB + SSW.

After the test

A significant F tells you that some means differ but not which ones; follow-up (post hoc) comparisons are needed. A non-significant F does not prove all means equal. Always plot the data (side-by-side box plots) next to the numbers. For unbalanced data hand calculations use the general formulas above; with equal group sizes there are shortcuts from group means and variances. In practice software is used.

Common mistakes

Using several t tests instead of ANOVA; writing Hₐ as "all means are different"; swapping numerator and denominator df; using a two-tailed rule; forgetting that ANOVA needs equal variances; concluding which groups differ directly from the overall F.

Practice tasks

  1. For ANOVA with 4 groups and 24 observations, state numerator and denominator df.
  2. s₁² = 25 (n₁ = 11), s₂² = 9 (n₂ = 16). Test H₀: σ₁² = σ₂² vs Hₐ: σ₁² > σ₂² (critical F(10,15) at 0.05 is 2.54).
  3. Groups A: 4, 5, 6; B: 6, 7, 8; C: 8, 9, 10. Find group means and the grand mean.
  4. For task 3 compute SSB, SSW, MSB, MSW.
  5. Compute F for task 3 and decide with the critical value F(2,6) = 5.14.
  6. SSB = 60, SSW = 90, k = 4, N = 24. Compute F and decide (critical F(3,20) = 3.10).
  7. Why do we not simply run several t-tests when comparing four means? What does a significant ANOVA allow you to claim?