One-Way ANOVA: Formula, Example and How to Calculate It by Hand

One-way ANOVA tests whether three or more group means are all equal. It answers one question: is there any difference somewhere among these groups? If the answer is yes, a post-hoc test tells you which groups differ.

A worked example

A farmer gives three feeds to three sets of five chickens and records each chicken’s weight gain in grams per day.

Feed AFeed BFeed C
20, 22, 19, 24, 2528, 30, 27, 26, 2921, 23, 22, 20, 24
Mean 22Mean 28Mean 22

Run the chicken-feed example in the ANOVA calculator

How ANOVA works, without the algebra

ANOVA compares two kinds of spread:

  • Between groups: how far the group means are from the overall mean. If the feeds make a difference, this will be large.
  • Within groups: how much chickens on the same feed differ from each other. This is the background noise.

The F statistic is the ratio of the two. If the feeds did nothing, the group means would differ only as much as the noise allows, and F would be around 1. A large F means the means are further apart than noise alone explains.

SourceSSdfMSFp
Between groups120260.015.650.0005
Within groups46123.83
Total16614

Reading the table: each mean square (MS) is a sum of squares divided by its df. F = 60.0 ÷ 3.83 = 15.65. With df = (2, 12), p = 0.0005, so the feeds don’t all give the same weight gain.

η² = 120 ÷ 166 = 0.72. The feed accounts for 72% of the variation in weight gain in this sample.

Which groups differ? Post-hoc tests

A significant F says at least one mean differs. It doesn’t say which. Tukey’s HSD compares every pair while keeping the overall false-positive rate at 5%:

ComparisonDifferenceAdjusted p
A vs B−60.001
A vs C01.000
B vs C60.001

So feed B beats both A and C, and A and C perform the same. That is the finding you would actually report to the farmer.

If the groups have clearly different spreads, use Games-Howell instead of Tukey. The calculator offers both, plus Bonferroni and Holm.

Assumptions and what to do when they fail

  • Independent observations. Each chicken in one group only, and chickens don’t share a feeder across groups.
  • Roughly normal data in each group. ANOVA tolerates mild departures, especially with equal group sizes. With small groups and clear skew, use the Kruskal-Wallis test.
  • Similar variances. A rule of thumb: worry if the largest SD is more than twice the smallest. Then use Welch’s ANOVA, which the calculator reports alongside the standard one.

Reporting

“Weight gain differed between feeds, F(2, 12) = 15.65, p < .001, η² = .72. Tukey’s HSD showed that feed B (M = 28.0) produced higher gains than both feed A (M = 22.0, p = .001) and feed C (M = 22.0, p = .001), which did not differ (p = 1.00).”

Check yourself

Four groups of 10. What are the degrees of freedom for F?

Between: 4 − 1 = 3. Within: 40 − 4 = 36. So F(3, 36).

ANOVA gives p = 0.03, but none of the Tukey comparisons is significant. Is that possible?

Yes, occasionally. The F test can pick up a pattern spread across several groups that no single pair shows strongly. Report the F result and say that no individual pair reached significance.