← All resources

One-Way ANOVA Test: What It Is, Assumptions, and Steps

9 min read
One-Way ANOVA Test: What It Is, Assumptions, and Steps

A one-way ANOVA test checks whether the means of three or more independent groups differ by more than chance would explain. It uses one categorical factor, such as treatment type, and one numeric outcome, such as blood pressure. The test compares the variation between group means with the variation within groups, then returns an F statistic and a p-value. A small p-value says at least one mean differs. It does not say which one.

This guide covers why the test matters, how to conduct it step by step with a worked example you can verify by hand, which assumptions it needs, and how robust it is when they fail. It ends with how to read and report the result.

We build PlotStudio AI for researchers who run comparisons like this every week, so the focus stays practical: what to check before you trust the p-value, and what to do after you get it.

Why the one-way ANOVA test matters

The one-way ANOVA test matters because it answers a question that appears in almost every experiment: do three or more groups share the same mean? It does so in one test with one error rate, instead of a pile of pairwise comparisons.

What the test tells you

The null hypothesis says all group means are equal (μ1 = μ2 = … = μk). The alternative says at least one mean differs. That makes ANOVA an omnibus test. It flags that a difference exists somewhere, but it cannot name the pair responsible. For that you need a post hoc test, covered later.

You will also see it called a single factor ANOVA test. It examines one factor, for example drug dose, with k levels and one numeric outcome. ANOVA is the family of methods, and "one-way" names the version with a single factor.

A significant one-way ANOVA tells you the groups are not all equal, never which ones differ.

Why not just run several t-tests

Every extra t-test adds another chance of a false positive. Pairwise t-tests at α = 0.05 inflate the overall error rate, roughly as 1 − 0.95^m for m comparisons. The table shows how fast it grows.

Bar chart showing the chance of a false positive rising from 14.3% to 40.1% as groups increase.

Groups Pairwise comparisons Approximate chance of at least one false positive
3 3 14.3%
4 6 26.5%
5 10 40.1%

One ANOVA holds the overall rate at your chosen α. You then run post hoc comparisons only if the omnibus test is significant.

Which test fits your design

Pick the one-way ANOVA when you have one factor, independent groups, and a numeric outcome. Change the test when the design changes.

Situation Better choice
Three or more independent groups, one factor One-way ANOVA
Exactly two groups t-test (the F statistic equals t squared)
Two factors, such as dose and sex Two-way ANOVA
Same subjects measured repeatedly Repeated-measures ANOVA
Unequal variances Welch ANOVA
Ordinal data or small, heavily skewed groups Kruskal-Wallis test

How to conduct a one-way ANOVA test

To conduct a one-way ANOVA test, state your hypotheses, check the assumptions, split the variation into between-group and within-group parts, and compare the resulting F ratio with its F distribution. Six steps cover it:

  1. State H0 (all means equal) and Ha (at least one differs), and set α, usually 0.05.
  2. Confirm the design: independent groups, one factor, a numeric outcome.
  3. Compute the sum of squares between groups (SSB) and within groups (SSW).
  4. Divide each by its degrees of freedom: k − 1 for between, N − k for within. The results are the mean squares.
  5. Compute F = MSB / MSW and find the p-value from an F distribution with (k − 1, N − k) degrees of freedom.
  6. If p < α, run a post hoc test and report an effect size.

A worked example by hand

Suppose five patients receive each of three doses, and you record improvement on a symptom score. The data below are illustrative. The grand mean is 7, and each group has n = 5.

Three pill bottles with low, medium, and high capsule counts beside a clipboard and pencil.

Group Scores Mean
Low dose 3, 5, 5, 6, 6 5
Medium dose 5, 6, 7, 8, 9 7
High dose 6, 8, 9, 10, 12 9

Between groups: SSB = 5 × [(5−7)² + (7−7)² + (9−7)²] = 5 × 8 = 40. Within groups, the squared deviations from each group mean sum to 6, 10, and 20, so SSW = 36. The ANOVA table follows.

Source SS df MS F p
Between groups 40 2 20 6.67 0.011
Within groups 36 12 3
Total 76 14

F = 20 / 3 = 6.67. The 5% critical value for F(2, 12) is about 3.89, so you reject H0.

The F ratio is simply between-group variance divided by within-group variance.

Running it in software

You rarely compute this by hand. Excel's Analysis ToolPak offers "Anova: Single Factor," R has aov(), and Python has scipy.stats.f_oneway. This snippet reproduces the table above.

from scipy import stats

low = [3, 5, 5, 6, 6]
medium = [5, 6, 7, 8, 9]
high = [6, 8, 9, 10, 12]

f_stat, p_value = stats.f_oneway(low, medium, high)
print(f_stat, p_value)  # about 6.67 and 0.011

If you prefer not to code, PlotStudio AI lets you upload a CSV and ask for the comparison in plain English. In Verification Mode you can review and approve the proposed methods and assumptions before anything runs, and you can inspect the generated Python afterward.

Assumptions and how robust the one-way ANOVA is

The one-way ANOVA assumes independent observations, roughly normal residuals within each group, and similar variances across groups. The test tolerates mild departures from the second, and from the third when group sizes are equal. It does not tolerate a failure of the first.

The three assumptions and how to check them

Assumption How to check If it fails
Independent observations Study design: no repeated measures, no clustering Use repeated-measures or mixed models
Normal residuals in each group Q-Q plot, histogram, Shapiro-Wilk test Transform the data or use Kruskal-Wallis
Equal variances Levene's test, compare group SDs Use Welch ANOVA

A common rule of thumb flags trouble when the largest group standard deviation is more than about twice the smallest. Treat that as a prompt to look closer, not a hard cutoff.

How robust the test is in practice

Normality is the most forgiving assumption. Group means behave more normally as samples grow, so moderate skew rarely distorts the p-value when each group has a reasonable number of observations. Heavy outliers combined with tiny groups are the real danger.

Unequal variances cause more damage, especially with unequal group sizes. If the smallest group has the largest variance, false positives climb well above your α. If the smallest group has the smallest variance, the test becomes too conservative. Welch ANOVA handles this and loses little power when variances are equal, so many analysts use it by default.

Independence has no safety net. Patients from the same clinic, or the same animals measured twice, make the p-value unreliable. Fix this in the design, not in the test.

The one-way ANOVA bends under mild non-normality, but it breaks when observations are not independent.

Significance tests for assumptions are themselves sensitive to sample size. Small samples rarely reject, and large samples reject trivial departures. Pair Levene and Shapiro-Wilk with plots.

How to interpret and report one-way ANOVA results

Read the p-value first, then the effect size, then the post hoc comparisons, and report all three. A p-value alone says only that the groups differ.

Reading F, p, and effect size

In the example, F(2, 12) = 6.67 and p = 0.011, below 0.05, so you reject the null hypothesis. Eta squared is SSB / SST = 40 / 76 = 0.53, meaning dose explains about 53% of the variance in this sample. Common benchmarks call 0.01 small, 0.06 medium, and 0.14 large.

Finding which groups differ

Tukey's HSD compares every pair while holding the overall error rate at α. For k = 3 and 12 error degrees of freedom, the critical studentized range value is about 3.77. So HSD = 3.77 × √(3 / 5) ≈ 2.92. Any mean difference larger than that is significant.

Three test tubes with rising liquid levels and a caliper measuring the gap between the highest and lowest.

Comparison Mean difference Larger than 2.92?
Low vs medium 2 No
Medium vs high 2 No
Low vs high 4 Yes

Only the low and high doses differ reliably. With unequal variances, use Games-Howell instead of Tukey.

Writing it up

Report the test, degrees of freedom, F, p, effect size, and the post hoc result. Adapt this template to your own values.

A one-way ANOVA showed a significant effect of dose on symptom improvement, F(2, 12) = 6.67, p = .011, η² = .53. Tukey HSD comparisons showed that the high-dose group (M = 9.0) improved more than the low-dose group (M = 5.0), a difference of 4.0 that exceeds the HSD of 2.92.

Add a box plot or violin plot with the individual points, and state how you checked the assumptions. Readers then judge the result for themselves.

Putting the one-way ANOVA test to work

The one-way ANOVA test compares three or more independent group means in a single step. Check independence in your design, look at residual plots and group spreads, and switch to Welch ANOVA or Kruskal-Wallis when the data demand it. A significant result calls for a post hoc test and an effect size, so report F, degrees of freedom, p, and eta squared together.

If you would rather skip the manual calculation, try PlotStudio AI free. The trial needs no credit card, and you can review the method and the code behind every result.

One-Way ANOVA Test: What It Is, Assumptions, and Steps | PlotStudio AI