One-Way ANOVA Explained: A Worked Example
Work through a one-way ANOVA example, distinguish two sources of variation, and see how the question changes with two factors.

What ANOVA compares
ANOVA means analysis of variance. In a one-way ANOVA, the question is whether population means are equal across groups defined by one factor. The method compares variation between the sample group means with variation among observations inside each group. When the group means are far apart relative to the within-group noise, the evidence against equal population means grows.
For example, imagine comparing scores from three teaching methods. The null hypothesis is that all three population mean scores are equal. The alternative is that at least one mean differs. A significant overall test does not say that every pair differs, identify the best method, or establish that the teaching method caused a difference.
Work through a small example
Use three invented groups for a transparent calculation: A has 2, 3, 4; B has 4, 5, 6; and C has 6, 7, 8. These deliberately small teaching data make the arithmetic easy to inspect; they are not a study or evidence for a teaching intervention.
| Group | Observations | Group mean | Within-group sum of squares |
|---|---|---|---|
| A | 2, 3, 4 | 3 | 2 |
| B | 4, 5, 6 | 5 | 2 |
| C | 6, 7, 8 | 7 | 2 |
The grand mean is 5. The within-group sum of squares is SSW = 2 + 2 + 2 = 6. The between-group sum of squares weights each squared distance from the grand mean by the group size: SSB = 3(3 − 5)² + 3(5 − 5)² + 3(7 − 5)² = 24.
There are k = 3 groups and N = 9 observations. Divide SSB by k − 1 = 2 to obtain a between-group mean square of 12. Divide SSW by N − k = 6 to obtain a within-group mean square of 1. Their ratio is F = 12 / 1 = 12, with numerator and denominator degrees of freedom 2 and 6. Compare that statistic with the appropriate F distribution to obtain a p-value.
For these illustrative numbers, the upper-tail p-value is 0.008. At a preselected 0.05 threshold, the test rejects equal means if its assumptions apply. That is an overall test result, not permission to claim that every pair of groups differs. Report the observed group differences and their uncertainty as well as the p-value.
Why the ratio matters
Imagine increasing the spread of every group while keeping the group means at 3, 5, and 7. The same separation of means would become less distinctive against the noisier observations. Conversely, tightly clustered groups make a difference in means easier to distinguish. This is the intuition behind comparing mean squares rather than simply looking at the largest and smallest mean.
The NIST ANOVA table reference gives the sums of squares, degrees of freedom, and F-test structure. The table above supplies a separate small example you can calculate by hand.
Check the assumptions and the study design
The classical one-way model assumes independent observations, normally distributed errors within groups, and a common error variance. Evaluate these assumptions using the design and suitable residual diagnostics; do not assume they hold just because the software reports a result. With three observations per group, the teaching example is particularly uninformative about the shape of the underlying distributions.
When variances differ, Welch’s ANOVA may be appropriate for independent groups. Repeated measurements, matched participants, or nested classrooms need methods that represent that dependence. A different test is not a substitute for understanding how the data were collected. After an overall rejection, planned contrasts or suitably adjusted pairwise comparisons, such as Tukey HSD when its assumptions are appropriate, can address which differences matter. Effect sizes and confidence intervals help distinguish a detectable difference from a useful one.
One factor versus two factors
The worked calculation uses one factor: group. Two-way ANOVA considers two factors and can examine whether the effect of one depends on the level of the other. For example, teaching method and practice schedule could have an interaction. An interaction is not simply another name for a large overall mean difference.
The animated grid above illustrates a two-factor layout with cells and group summaries. It is an existing visual excerpt, not the output of the one-way calculation on this page. Keeping that distinction explicit prevents a helpful picture from teaching the wrong model.
Storyboard the two sources of variation
Use the three groups in the worked table to explain the calculation before showing a test result. This is a proposed teaching sequence for those numbers; the two-factor clip above is a separate illustration.
- Plot the nine observations on a shared numerical scale, grouped as A, B, and C.
- Mark each group mean and the grand mean of 5. Distinguish distances to a group mean from distances between group means and the grand mean.
- Show the within-group squared deviations summing to 6 and the weighted between-group squared deviations summing to 24.
- Reveal the degrees of freedom, then the mean squares 1 and 12, and finally F = 12. State the model assumptions before interpreting the p-value.
Ask: “If the group means stayed fixed but observations spread farther apart, would the ratio rise or fall?” Greater within-group variation increases the denominator and reduces the ratio. This checks the underlying comparison rather than recall of the acronym.
Continue learning or make the lesson
For category counts instead of numeric group means, compare the chi-square test example. Browse animation examples to choose a visual pattern for another mathematical idea.
To plan your own scene, follow how to make math animations. If your explanation starts in a worksheet or lecture notes, use the notes-to-video workflow to keep inputs, narration, and checks aligned. The math animation software guide helps choose a production approach; this article itself is a worked explanation, not a statistical calculator.