Statistics

One-Way ANOVA Calculator

Compare the means of three or more groups in one test. Paste your groups straight from Excel, or enter each group’s mean, standard deviation and size, and get the full ANOVA table, effect size, Tukey HSD comparisons showing which groups differ, and the assumption checks.

Your groups

Paste your groups and press Calculate, or load the example.

What this calculator does

One-way analysis of variance (ANOVA) tests whether the means of three or more independent groups are all equal. It splits the total variation in the data into two parts: variation between the group means and variation within each group. If the between-group variation is large relative to the within-group variation, the group means are unlikely to be equal.

Alongside the F-test, the calculator reports η² and ω² effect sizes, Tukey HSD post-hoc comparisons for every pair, Levene’s test for equal variances and Welch’s ANOVA, the version that does not assume equal variances.

The formulas

SSbetween = Σ ni(x̄i − x̄)²   ·   SSwithin = Σ (ni − 1)si²
MS = SS / df,   dfbetween = k − 1,   dfwithin = N − k
F = MSbetween / MSwithin   ·   η² = SSbetween / SStotal

The p-value comes from the F distribution with (k − 1, N − k) degrees of freedom. Tukey HSD compares each pair with q = |x̄i − x̄j| / √(MSwithin/2 × (1/ni + 1/nj)) against the studentized range distribution (the Tukey–Kramer form, which handles unequal group sizes).

Worked example: shelf placement and snack sales

Press Load example. A snack brand tracked average daily sales, in ₹ thousand, across 23 stores in Bengaluru with its product placed at eye level (8 stores), on the bottom shelf (7) or on an end-cap display (8).

  • Group means: eye level 52.38, bottom shelf 46.66, end cap 54.55.
  • ANOVA: F(2, 20) = 16.89, p < 0.0001. At least one placement has different average sales.
  • Effect size: η² = 0.628 and ω² = 0.580, so placement accounts for well over half of the store-to-store variation.
  • Tukey HSD: eye level beats bottom shelf by 5.72 (p = 0.0015) and end cap beats bottom shelf by 7.89 (p < 0.0001), but end cap vs eye level, a gap of 2.18, is not significant (p = 0.26).
  • Assumptions: Levene’s test p = 0.79, so equal variances are reasonable; Welch’s ANOVA agrees (p = 0.0001).

The business reading: get off the bottom shelf. Paying extra for an end cap over eye level is not supported by this data, though a larger study might detect a smaller gain.

Assumptions

  • Independent observations within and across groups.
  • Roughly normal data in each group, which matters most for small groups. ANOVA is fairly robust with 15 or more per group.
  • Equal variances across groups. If Levene’s test is significant, report Welch’s ANOVA instead, and treat Tukey HSD with caution.

Getting the same result in Excel and Python

In Excel, enable the Analysis ToolPak and use Data → Data Analysis → Anova: Single Factor on the group columns. It gives the ANOVA table but no post-hoc test. In Python:

from scipy import stats

eye    = [52.4, 48.9, 55.1, 50.6, 57.3, 49.8, 53.7, 51.2]
bottom = [45.3, 48.7, 43.9, 47.2, 50.1, 44.6, 46.8]
endcap = [53.1, 57.4, 50.3, 54.7, 58.9, 51.6, 56.0, 54.4]

print(stats.f_oneway(eye, bottom, endcap))   # F = 16.89, p = 5.1e-05
print(stats.tukey_hsd(eye, bottom, endcap))  # pairwise differences, p-values, intervals
print(stats.levene(eye, bottom, endcap))     # equal-variance check

Common mistakes

  • Stopping at a significant F. It does not say which groups differ. Always follow with a post-hoc test.
  • Running post-hoc tests after a non-significant F and reporting whichever pair looks different.
  • Using one-way ANOVA on repeated measurements of the same people or stores. That needs repeated-measures ANOVA.
  • Treating ordered categories as unordered. If the groups are doses or price levels, a trend test or regression usually answers the real question better.

Related learning on Codeayan

FAQ

ANOVA questions

Why not just run t-tests between every pair of groups?

Every extra test adds another chance of a false positive. With 4 groups there are 6 pairs, and running 6 separate t-tests at α = 0.05 pushes the chance of at least one false "significant" result to roughly 26%. ANOVA tests all the groups at once with one F-test, and a post-hoc test such as Tukey HSD then compares pairs while keeping the overall error rate at 5%.

ANOVA is significant. Which groups are different?

ANOVA only says that at least one group mean differs from the others. To find which ones, read the Tukey HSD tab: each pair has an adjusted p-value and a confidence interval for the difference. Pairs whose interval excludes zero differ significantly.

What if the groups have different variances?

Check Levene's test in the Assumptions tab. If it is significant, the equal-variance assumption behind the classic F-test is doubtful, and Welch's ANOVA (also reported there) is the safer result. Welch's version does not assume equal variances and works well with unequal group sizes.

What do η² and ω² mean?

Both measure effect size: the share of the total variation explained by group membership. η² (eta squared) is the simple ratio SS between / SS total but overstates the effect in small samples. ω² (omega squared) corrects for that and is the better estimate for the population. Rough guides: 0.01 small, 0.06 medium, 0.14 large.

Can I run ANOVA from means and standard deviations only?

Yes. Choose "Summary statistics" and enter each group's name, n, mean and standard deviation. The F-test, Welch's ANOVA and Tukey HSD all work from summaries. Levene's test needs the raw values, so it is skipped in that mode.

More tools

Keep going