Method · Statistics Library

One-way ANOVA

One-way ANOVA tests whether the means of a continuous variable differ across three or more independent groups by comparing between-group variability to within-group variability, with eta-squared as the effect size, Welch's ANOVA for groups with unequal spreads, and Tukey HSD, Bonferroni or Games-Howell as post-hoc options.

Topic indexA reference reading outside the guided chapter sequence

Understand the idea

One-way ANOVA generalizes the two-sample t-test to three or more groups: instead of comparing just two averages, it asks whether the AVERAGES ACROSS ALL THE GROUPS vary more than you'd expect from ordinary random noise within each group. It does this by literally comparing two kinds of variation: how much the group means themselves bounce around (between-group), against how much individual observations bounce around within their own group (within-group). A large ratio of the first to the second means the groups genuinely differ.

A significant F-test tells you that SOME group differs from the others: it does not tell you WHICH ones. That is exactly what a post-hoc test (Tukey HSD, the gold standard for comparing every pair; or the simpler, more conservative Bonferroni) is for: a systematic follow-up comparing every pair of groups while still controlling the overall chance of a false alarm across all those comparisons.

Eta-squared answers 'how much of the total variation in the outcome is explained by which group someone belongs to'; the standard benchmarks are 0.01 small, 0.06 medium, 0.14 large. Remember that a tiny eta-squared can still reach statistical significance with a big enough sample, so always look at the actual size of eta-squared, not just whether the F-test crossed the significance line.

ANOVA stands for analysis of variance.

Practitioner explanation

KernelStats computes F = MS_between/MS_within with the standard SS decomposition (SS_between = sum(n_i*(xbar_i-xbar)^2), SS_within = sum over groups of within-group SS), reporting BOTH eta-squared (SS_between/SS_total) and omega-squared (a less-biased version) as effect sizes. Homogeneity of variance is checked SPECIFICALLY with the MEDIAN-centered Levene statistic (the Brown-Forsythe test), and the card's assumption row is labeled that way explicitly; the product states directly that median-centering is the ROBUST variant, far less sensitive to skew and outliers than the original mean-centered Levene statistic, so the two genuinely give DIFFERENT numbers on the same data; the standalone Equal Variances test runs the same Brown-Forsythe check by default and offers the mean-centered version as an option.

Tukey HSD and Bonferroni use the ANOVA's OWN pooled error term MS_within on N-k degrees of freedom, which is why their table's degrees of freedom match the F-test's own denominator df. When the Brown-Forsythe row shows that the variances genuinely differ, set Which version to Welch's ANOVA and the follow-up to Games-Howell: Welch's F does not pool the variances, and Games-Howell compares each pair using only its own two groups' variances and sizes. The card also lists Welch's ANOVA and the Alexander-Govern test (a different unequal-variance statistic, A on chi-square with k - 1 df) under Alternative Tests, so either can be read without running again.

A group with EXACTLY ONE observation is KEPT in the model, exactly as R's aov() keeps it, explicitly NOT silently discarded the way an earlier version of this card once did: its mean contributes to SS_between, it contributes zero to SS_within, and it costs one degree of freedom. Such a singleton group gets no normality check of its own (there is no spread to check) and its Tukey HSD and Bonferroni comparisons rest entirely on the pooled MS_within, which the product states should be read as indicative only; Games-Howell and Welch's ANOVA need at least two observations in every group, so the card reports no Games-Howell comparisons and refuses Welch's ANOVA in that case. Kruskal-Wallis is computed AUTOMATICALLY on every run and listed alongside the parametric result as a rank-based cross-check, so it is already there when normality is doubtful.

When to use it

Consider it when

Comparing the means of one continuous response across three or more INDEPENDENT groups, when you want to know whether any group mean differs from the others.

Use caution when

Data are clearly non-normal at small sample sizes (Kruskal-Wallis, run automatically alongside, is the rank-based alternative), variances differ substantially across groups per the Brown-Forsythe check (set Which version to Welch's ANOVA and the follow-up to Games-Howell, which do not assume equal spreads, rather than reading the pooled F-test and pooled post-hoc tables), or the same subjects were measured repeatedly across conditions (use repeated-measures ANOVA, not this independent-groups version).

Formulas and symbols

One-way ANOVA F statistic

F=MSbetweenMSwithin=SSbetween/(k−1)SSwithin/(N−k)F = \dfrac{MS_{\text{between}}}{MS_{\text{within}}} = \dfrac{SS_{\text{between}}/(k-1)}{SS_{\text{within}}/(N-k)}

k groups, N total sample size. A large F means group means vary more than within-group noise would explain.

Eta-squared

η2=SSbetweenSStotal\eta^2 = \dfrac{SS_{\text{between}}}{SS_{\text{total}}}

Proportion of total variance explained by group membership. Cohen's marks: 0.01 small, 0.06 medium, 0.14 large.

Tukey HSD studentized range statistic

q=∣xˉi−xˉj∣MSwithin/2×(1/ni+1/nj)q = \dfrac{|\bar x_i - \bar x_j|}{\sqrt{MS_{\text{within}}/2 \times (1/n_i + 1/n_j)}}

Referred to the studentized-range distribution with parameters k and N-k; gives simultaneous family-wise-level intervals for every pairwise comparison.

Assumptions and checks

  • Independence of observations. Observations within and across groups must be independent; violating this invalidates the F-test regardless of what the normality and variance checks show.

    In KernelStats: Not checkable from the data alone: it is a property of how the data were collected.

  • Normality (of residuals, not of the raw data). Non-normal data within one or more groups distort the F-test's true Type I error rate, though the test is fairly robust to mild violations, especially when group sizes are similar.

    In KernelStats: Shapiro-Wilk (and Anderson-Darling where applicable) run separately on each group, reported directly on the card.

  • Homogeneity of variance (homoscedasticity). Unequal variance across groups, especially combined with unequal group sizes, distorts the F-test's true Type I error rate: it can become too liberal or too conservative depending on which group is larger and which is noisier.

    In KernelStats: The Brown-Forsythe statistic (median-centered Levene's test), reported directly on the card and explicitly named as Brown-Forsythe rather than plain Levene, since KernelStats' own Equal Variances Test reserves that name for its mean-centered option (its default is this same Brown-Forsythe check), and the two forms can print materially different numbers on the same data.

Alternatives

  • Kruskal-Wallis Test. Normality is doubtful or the response is ordinal: the rank-based nonparametric alternative, run automatically alongside this test.
  • Equal Variances Test. You specifically want the mean-centered (original) Levene statistic rather than the median-centered Brown-Forsythe variant this card checks; it is an option on that card, whose default is the same Brown-Forsythe check.
  • Repeated-Measures ANOVA. The same subjects were measured under every condition (a repeated-measures design) rather than independent groups.

Worked example

Scenario

Comparing average test scores across three teaching methods (n=25 per group).

Result

F(2, 72) = 9.84, p < .001, eta-squared = 0.21 (large); Tukey HSD shows method C significantly outperforms both A and B, with A and B not significantly different from each other.

Interpretation

Scores differ substantially across the teaching methods, not merely detectably (a causal reading, that the methods produced the difference, needs random assignment of students to methods), and the post-hoc comparisons pinpoint method C specifically as the standout; methods A and B cannot yet be distinguished from each other at this sample size.

Common misconceptions

Misconception

A significant one-way ANOVA F-test tells you which specific groups differ from each other.

Correction

A significant F only establishes that AT LEAST ONE group mean differs from the others somewhere: it says nothing about WHICH pair or pairs are responsible. A post-hoc test (for example Tukey HSD, Bonferroni or Games-Howell) is specifically designed to answer that follow-up question while controlling the family-wise error rate across all the pairwise comparisons.

Read more: Misconception: a significant ANOVA means every group differs from every other group

Misconception

A very small p-value from the ANOVA F-test means the group differences are large or practically important.

Correction

The p-value answers 'could this be noise?', not 'how big is the effect?'. With a large enough sample, a trivially small eta-squared (say 0.002) can still produce p < .001. Read eta-squared (or omega-squared) and the actual group means to judge practical importance, not the p-value alone.

Read more: Misconception: statistical significance means practical importance

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §7.4.3 One-Factor ANOVA, NIST/SEMATECH (2012), §7.4.3.
  2. Design and Analysis of Experiments, Montgomery, D. C. (2019).