What does the F statistic measure?
Imagine three samples from populations with the same mean. Their sample means will usually differ by chance. ANOVA asks whether the observed separation is unusually large given the variation within the groups.
Change one distance at a time
Each row contains three observations. All three rows use the same horizontal scale. First bring all three group means together. What happens to the gain from using group labels? Then restore the gap to two and double the within-group distance.
Between-group mean square = 12
Within-group mean square = 1
F = 12 / 1 = 12
Explain the doubling experiment
When the means coincide, the labels buy no reduction in squared error and F is zero. With a gap of two and an outer distance of one, F is 12. Doubling the outer distance quadruples the remaining squared error and lowers F to 3. Scaling both distances by the same factor leaves F unchanged.
See the geometry of the starting example
What does a group label buy you?
Cover the labels. Your best single prediction under squared error is the overall mean, zero. Each dot is an observation. The horizontal distance from the prediction line to a dot is the size of a miss. Build a square on that distance: its area counts the squared error.
Squared error remaining 30 / 30 · Removed 0
Why do some squares survive?
At the group means, each middle dot is predicted exactly. The two outer dots in each group are still one unit away. Six unit squares survive. The change from one mean to three removed 24 units of squared error; all 24 came from differences between the group means.
Why does moving a line to the mean minimize the area?
Take group C. Its dots are at 1, 2 and 3. Place the prediction line at 2 + h. Relative to that line, the three misses are −1 − h, −h and 1 − h. Squaring and adding gives
The linear terms cancel because the deviations around the mean sum to zero. Moving the line either way adds three copies of the same squared shift. At h = 0 only the two unit squares remain. The same cancellation works for an asymmetric group: a shift h from its mean adds n times h squared for n observations.
Fitting three means spent two extra degrees of freedom and removed 24 units of squared error. The gain per extra degree of freedom is 12. The residual error per remaining degree of freedom is 6/6 = 1. Their ratio is the F statistic.
Rebuild the ratio from the dots
Between groups, measure each group mean from the grand mean (zero here). Square those distances so opposite signs cannot cancel. Weight each squared distance by the number of observations it represents. Here each mean represents three observations.
Within each group, measure every observation from its own group mean. The three deviations are the negative outer distance, zero, and the positive outer distance. All three groups contribute the same sum of squares in this example.
Why divide by 2 and 6?
Once the grand mean is fixed, two group means determine the third in this balanced example. That leaves two independent directions of between-group variation. Within each group the three deviations sum to zero, so two determine the third. Three groups contribute six residual degrees of freedom. Dividing each sum of squares by its degrees of freedom gives a mean square. Under equal population means and a common error variance, both mean squares estimate that same variance.
Write it for any number of groups
Group j contains nⱼ observations. Its mean is ȳⱼ, the overall mean is ȳ, k counts the groups, and N counts all observations.
When does the ratio become a test?
The dots above are constructed to explain the arithmetic. For sampled data, the classical one-way test assumes independent normal errors with a common variance. If all population means are equal, F then follows an F distribution with k−1 and N−k degrees of freedom. Its upper tail tells us how unusual a ratio at least this large would be under that model.
A large F can give evidence that the means differ somewhere. To say which groups differ and by how much, estimate the relevant contrasts and their uncertainty. Repeated observations on the same person require a model that accounts for their dependence.
At the starting settings the observed ratio is 12. Under the equal-means model above, the reference distribution is F with 2 and 6 degrees of freedom. About 0.8% of repetitions under that model would give F ≥ 12. This tail area refers to repetitions under the null hypothesis. It does not assign a probability to that hypothesis.
Use the same idea in regression
The ANOVA example compared squared errors around group means. In least-squares regression, ask a related question: which line makes the sum of squared errors smallest?
Further reading
Illowsky & Dean, Introductory Statistics 2e, §13.2 · Derives the two mean squares and relates their ratio to the F distribution.
Gelman (2005), Analysis of variance—why it is more important than ever · A broader modeling perspective on grouping effects and estimating variation.