Analysis of variance (ANOVA) tests whether the means of three or more groups are all equal. A one-way ANOVA compares the variation between group means with the variation among observations within each group. Its F-statistic tests the overall question; a significant result says at least one mean differs, but does not identify which groups differ.
One-way ANOVA formulas
Suppose there are $k$ independent groups. Group $j$ has $n_j$ observations $x_{ij}$ and mean $\bar{x}_j$. Let $N=\sum_{j=1}^{k}n_j$ be the total number of observations and $\bar{x}$ the grand mean across all observations. The between-group and within-group sums of squares are:
The degrees of freedom are $k-1$ between groups and $N-k$ within groups. Dividing each sum of squares by its degrees of freedom gives the mean squares:
The test statistic and its null distribution are:
The p-value is the upper-tail probability for the observed F-statistic. One descriptive measure of the share of total variation associated with group membership is eta-squared:
Worked example
Three process settings each have four measured results, in the same units:
- Setting A: $8,9,10,9$, with mean $9$
- Setting B: $10,11,12,11$, with mean $11$
- Setting C: $12,13,14,13$, with mean $13$
The grand mean is $11$. The between-group sum of squares is $4(9-11)^2+4(11-11)^2+4(13-11)^2=32$. The within-group sum of squares is $2+2+2=6$. Thus $k=3$, $N=12$, $MS_{\text{between}}=32/2=16$, and $MS_{\text{within}}=6/9\approx0.667$. The test gives $F=24$ with $(2,9)$ degrees of freedom, with an upper-tail p-value of approximately $0.00025$. Eta-squared is $32/(32+6)\approx0.842$. These values indicate a strong difference among these sample means, but the overall test alone does not say which settings differ.
Assumptions and next steps
- Observations should be independent within and across groups. Repeated measurements on the same unit require a repeated-measures or blocked analysis rather than this ordinary one-way formula.
- Within each group, residuals (observations minus their group mean) should be reasonably well behaved, with no severe outliers. The normality condition concerns residuals, not the distribution of the group means.
- The groups should have reasonably similar variances for the classical F-test. If spreads differ substantially, consider a Welch one-way ANOVA.
- After a significant overall test, use planned contrasts or multiple-comparison-adjusted follow-up tests to identify differences while controlling false positives. Do not infer that every pair differs.
- Report group means, sample sizes, an effect-size measure, and uncertainty. Statistical significance does not by itself establish that a process change is practically important.
Use one-way ANOVA for one categorical factor with independent groups and a numeric outcome. For multiple factors, interactions, or repeated measurements, choose a model that reflects that design instead of forcing the data into this formula.