ONE-WAY ANOVA CALCULATOR

One-way ANOVA calculator

Enter each group on its own line, get F and the p-value.

What does one-way ANOVA test?

Whether three or more group means are all equal. It compares the spread between group means with the spread within the groups: F = MS between ÷ MS within. The null hypothesis is that every group has the same population mean; the alternative is that at least two of them differ (NIST/SEMATECH e-Handbook, section 7.4.3).

How is F calculated?

The between-groups sum of squares, SSB = Σ nᵢ(x̄ᵢ − x̄)², measures how far each group mean sits from the grand mean x̄, weighted by group size. The within-groups sum of squares, SSW = ΣΣ(xᵢⱼ − x̄ᵢ)², adds up the squared distances of the values from their own group mean. SSB is divided by k − 1 degrees of freedom and SSW by N − k, where k is the number of groups and N the total count; F is the ratio of those two mean squares. If the null hypothesis is true, both estimate the same error variance and F is close to 1. If it is false, only the between-groups mean square grows (NIST section 7.4.3.3), so only the upper tail of the F distribution gives the p-value.

Worked example: three groups of five

The NIST handbook (sections 7.4.3.3 and 7.4.3.4) measures the change in resistance of identical resistors held at three temperatures, five resistors per temperature. All 15 values add up to 108.1, so the grand mean is 7.207. The group means are 5.34, 7.72 and 8.56. The between-groups sum of squares is 27.897 with 2 degrees of freedom, so MS between = 13.949. The within-groups sum of squares is 17.452 with 12 degrees of freedom, so MS within = 1.454. Then F = 13.949 ÷ 1.454 = 9.59. The 5% critical value for 2 and 12 degrees of freedom is 3.89, and 9.59 is well beyond it; the p-value is 0.00325. Conclusion: the three means are not all equal.

What does a small p-value mean?

That differences this large would be unlikely if all the true means were equal. ANOVA does not say which groups differ — a follow-up comparison is needed for that.

Which test do I run after a significant F?

The NIST handbook (section 7.4.7) separates three cases. Tukey’s method compares every pair of means and keeps the overall error rate at the level you chose. Scheffé’s method covers any contrast chosen after seeing the data, such as the average of groups 1 and 2 against the average of 3 and 4. The Bonferroni method suits a short list of comparisons decided before the experiment. Running ordinary two-sample tests on every pair instead is the mistake that multiple-comparison procedures exist to avoid.

What does ANOVA assume?

Independent observations, roughly normal data within each group, and similar variances across groups. In the model written down by NIST (section 7.4.3.2) the errors are normally and independently distributed with mean zero and constant variance. OpenStax adds that the samples should be random and that the response is a number while the grouping factor is a category.

Common mistakes with one-way ANOVA

First, running a series of t-tests instead. Three groups already make three pairs, ten groups make forty-five, and each extra test at 5% adds to the chance of a false alarm; if the tests were independent, three of them would give a 14.3% chance of at least one false positive and ten would give 40.1%. Second, reading a significant F as “all groups differ”: one group can sit far from the rest while the others are identical. Third, using one-way ANOVA on repeated measurements of the same people; those observations are not independent and need a repeated-measures design.

Can I use ANOVA for two groups?

Yes, and it gives the same answer as the pooled-variance two-sample t-test: F equals t² and the p-values match. With two groups the t-test is usually more convenient because it also reports the direction of the difference and allows a one-sided test.

Sources: NIST/SEMATECH e-Handbook of Statistical Methods, sections 7.4.3 (“Are the means equal?”), 7.4.3.2 to 7.4.3.4 (model, ANOVA table and hand calculations) and 7.4.7 (“Multiple comparisons”); OpenStax, Introductory Statistics 2e, section 13.1 (One-Way ANOVA). Related: t-test calculator, F-test for two variances, critical value calculator, standard deviation calculator and statistical power calculator.