Skip to content
DeviceCheckHub

ANOVA Calculator

Compare the means of two to twenty groups with a one-way ANOVA. Paste your groups straight from a spreadsheet and get the ANOVA table, p-value, effect size, Tukey comparisons of every pair and each step.

Your groups

F = 9.724 with 3 and 16 degrees of freedom, p = 0.0006845. 4 of 6 pairs differ by Tukey’s test.

F(3, 16) = 9.724, p = 0.0006845

Significant at α = 0.05: reject the null hypothesis that all 4 group means are equal.

02.557.510
F
9.724
Degrees of freedom
3 and 16
p-value
0.0006845
Critical F (α = 0.05)
3.2389
η² (eta squared)
0.6458
ω² (omega squared)
0.5668
Welch’s F
8.073 (df 3 and 8.8374), p = 0.006672
Equal variances (Brown–Forsythe)
F = 0.2327, p = 0.8722
Tukey critical q (95%)
4.0461

ANOVA table

BetweenWithinTotal
Sum of squares38.8221.29260.112
df31619
Mean square12.941.33075
F9.724
p-value0.0006845

Group means

Each dot is a group mean, with its 95% confidence interval from the pooled standard deviation.

Group 1Group 2Group 3Group 446810
GroupnMeanSD
Group 155.341.11714
Group 257.721.10318
Group 358.561.37768
Group 455.50.979796

Tukey HSD: every pair

Pairs in bold differ at α = 0.05. The intervals hold together with 95% confidence.

PairDiffer­ence95% intervalp (adj.)
Group 1 − Group 2−2.38−4.467 to −0.29260.02279
Group 1 − Group 3−3.22−5.307 to −1.1330.002211
Group 1 − Group 4−0.16−2.247 to 1.9270.9961
Group 2 − Group 3−0.84−2.927 to 1.2470.6645
Group 2 − Group 42.220.1326 to 4.3070.03515
Group 3 − Group 43.060.9726 to 5.1470.003451

In R: value <- c(6.9, 5.4, 5.8, 4.6, 4, 8.3, 6.8, 7.8, 9.2, 6.5, 8, 10.5, 8.1, 6.9, 9.3, 5.8, 3.8, 6.1, 5.6, 6.2); group <- factor(rep(c("Group 1", "Group 2", "Group 3", "Group 4"), times = c(5, 5, 5, 5))); fit <- aov(value ~ group); summary(fit); TukeyHSD(fit, conf.level = 0.95); oneway.test(value ~ group)

Step by step

  1. Hypotheses: H₀: all 4 group means are equal (μ₁ = μ₂ = …), against Hₐ: at least two of them differ.
  2. Grand mean x̄ = Σ nᵢx̄ᵢ / N = 6.78, over N = 20 values in k = 4 groups.
  3. Between groups: SS = Σ nᵢ(x̄ᵢ − x̄)² = 38.82, with k − 1 = 3 degrees of freedom, so MS = 38.82 / 3 = 12.94.
  4. Within groups: SS = Σ (nᵢ − 1)sᵢ² = 21.292, with N − k = 16 degrees of freedom, so MS = 21.292 / 16 = 1.33075.
  5. F = MS between / MS within = 12.94 / 1.33075 = 9.724.
  6. p-value: the area to the right of 9.724 under the F distribution with 3 and 16 degrees of freedom, p = 0.0006845. That is below α = 0.05, so reject H₀.
  7. Tukey–Kramer: a pair differs when |x̄ᵢ − x̄ⱼ| is more than q × √(MS within / 2 × (1/nᵢ + 1/nⱼ)), where q = 4.0461 is the studentized range for 4 means and 16 degrees of freedom at α = 0.05. 4 of 6 pairs differ by Tukey’s test.
  • With fewer than 30 values in a group, ANOVA assumes each group comes from a roughly normal population. Check for strong skew or outliers.

How to use the ANOVA calculator

  1. Enter each group on its own line, starting with a name and a colon if you like, or choose “Groups in columns” and paste columns from a spreadsheet with their names in the first row.
  2. If you only have each group’s size, mean and standard deviation, choose “Summary stats” and enter one group per line.
  3. The F test, ANOVA table, chart, Tukey comparisons and steps update as you type. Change α to test at another level.

What one-way ANOVA tests

One-way analysis of variance (ANOVA) asks whether the means of several independent groups are all the same. In OpenStax’s words, “The null hypothesis is simply that all the group population means are the same. The alternative hypothesis is that at least one pair of means is different.” “One-way” means there is a single factor, such as the treatment, the brand or the class, that splits the values into groups.

Why not run a t test on every pair? With four groups there are six pairs, and each test at α = 0.05 has its own 5% chance of a false alarm. Together, the chance that at least one of them goes off by luck is far above 5%: about 1 − 0.95⁶ ≈ 26% if the tests were independent. ANOVA answers the overall question with a single test at the level you choose.

The ANOVA table

ANOVA splits the total variation into two parts. The between-groups sum of squares measures how far the group means sit from the grand mean, and the within-groups sum of squares measures the spread of the values around their own group mean. Dividing each by its degrees of freedom (k − 1 between groups and N − k within, for k groups and N values) gives two mean squares, and F is their ratio. NIST’s handbook explains why that works: when the null hypothesis is true, “the two mean squares estimate the same quantity (error variance), and should be of approximately equal magnitude. In other words, their ratio should be close to 1.” The p-value is the area to the right of F under the F distribution.

A worked example

The starting data come from the NIST/SEMATECH e-Handbook of Statistical Methods: four treatments, each replicated five times. The group means are 5.34, 7.72, 8.56 and 5.5, and the grand mean is 6.78. The between-groups sum of squares is 5 × ((5.34 − 6.78)² + (7.72 − 6.78)² + (8.56 − 6.78)² + (5.5 − 6.78)²) = 38.82, and the within-groups sum of squares is 21.292. So the mean squares are 12.94 on 3 degrees of freedom and 1.331 on 16, and F = 9.724, which matches NIST’s table. The p-value is 0.0006845, so at the 5% level the four treatment means are not all equal.

Not every set of groups differs. OpenStax’s example of mean grades in four sororities, with five members sampled from each, gives F(3, 16) = 2.23, p = 0.1241. At the 1% level they used, or at 5%, there is no evidence of a difference. Paste their numbers to see it.

Which groups differ: Tukey’s HSD

A significant F says that at least two means differ, but not which. Tukey’s honestly significant difference (HSD) method compares every pair at once. NIST describes it as applying “simultaneously to the set of all pairwise comparisons,” with a confidence coefficient of exactly 1 − α when the groups are the same size. Each interval is the difference in means ± q × √(MS within / n), where q comes from the studentized range distribution; here q = 4.0461 for 4 means and 16 degrees of freedom.

For the NIST data, the interval for μ₂ − μ₁ runs from 0.29 to 4.47, as in the handbook, so treatment 2 has the higher mean. The intervals for μ₁ − μ₄ (−2.25 to 1.93) and μ₂ − μ₃ (−2.93 to 1.25) include 0, so those pairs aren’t significantly different, and the other four pairs are. When the groups have different sizes, the calculator uses the Tukey–Kramer version, which works out the standard error for each pair; NIST notes the method is then conservative.

Assumptions

OpenStax lists five basic assumptions: “Each population from which a sample is taken is assumed to be normal. All samples are randomly selected and independent. The populations are assumed to have equal standard deviations (or variances). The factor is a categorical variable. The response is a numerical variable.” With small groups, look at each group for strong skew or outliers before trusting the p-value.

When the spreads differ: Welch’s ANOVA

If the groups look unequally spread, check the equal-variance assumption. The calculator does it with Levene’s test in the form NIST recommends, based on each value’s distance from its group median, which NIST says “provides good robustness against many types of non-normal data while retaining good power.” This median version is often called the Brown–Forsythe test. It also reports Welch’s ANOVA, which weights each group by n / s² and doesn’t assume equal variances. For the NIST data, Welch’s F is 8.073 (df 3 and 8.8374), p = 0.006672.

Effect size

With large groups, even tiny differences in means become significant, so it helps to know how large the effect is. Eta squared, η² = SS between / SS total, is the share of all the variation that lies between the groups: 0.6458 for the NIST data. Omega squared, ω² = (SS between − (k − 1) × MS within) / (SS total + MS within), first takes away (k − 1) × MS within, the between-groups variation you would expect from chance alone, so it is a little smaller: 0.5668 here.

ANOVA from means and standard deviations

Published papers often give only each group’s size, mean and standard deviation. That is enough for the whole F test, because the within-groups sum of squares is Σ (nᵢ − 1)sᵢ², and also for Welch’s ANOVA and Tukey’s comparisons. Choose “Summary stats” and enter one group per line. Only the Brown–Forsythe check needs the individual values.

In Excel or R

In Excel, the Analysis ToolPak’s “Anova: Single Factor” tool performs, in Microsoft’s words, “a simple analysis of variance on data for two or more samples,” but it doesn’t compare the pairs. In R, aov fits the model, summary shows the ANOVA table, TukeyHSD compares the pairs and oneway.test runs Welch’s ANOVA. The calculator writes the exact R code for your raw data under the result.

Your data stays on your device

Everything is worked out in your browser. Nothing you type or paste is sent anywhere or stored.

Frequently asked questions

How do I paste groups from Excel or Google Sheets?

Choose “Groups in columns”, select your columns with their names in the first row, copy them and paste into the box. Empty cells are skipped, so the groups can have different sizes.

Can I use means and standard deviations instead of raw data?

Yes. Choose “Summary stats” and enter one group per line: a name if you like, then the group size, mean and standard deviation. The F test, Welch’s test and Tukey comparisons are exactly the same; only the Brown–Forsythe check needs the raw values.

The F test is significant. Which groups differ?

A significant F only says that at least two means differ. The Tukey table compares every pair while keeping the overall error rate at α, and the pairs in bold are the ones that differ.

Can I run ANOVA on just two groups?

Yes. With two groups, one-way ANOVA gives the same p-value as the pooled two-sample t test, and F is the square of t.

What if the groups have different spreads?

Look at Welch’s F, which doesn’t assume equal variances. The calculator also runs the Brown–Forsythe test on raw data and points to Welch’s result when the variances look different.

Is my data uploaded?

No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.

Last updated · About DeviceCheckHub