One-way ANOVA purpose and application
Comparing means across multiple groups
One-way ANOVA (Analysis of Variance) is a statistical method for comparing the means of three or more groups defined by a single categorical factor, measured on a continuous dependent variable. Think of it as the natural extension of the independent samples t-test: where a t-test handles two groups, ANOVA handles any number of groups simultaneously.
- The goal is to determine whether there are statistically significant differences among the group means (e.g., comparing average test scores across five different schools, or comparing treatment effects across three drug dosages)
- Running multiple pairwise t-tests instead of a single ANOVA would inflate your Type I error rate. ANOVA controls this by testing all groups in one omnibus test.
Hypothesis testing in one-way ANOVA
- The null hypothesis states that all group population means are equal
- The alternative hypothesis states that at least one group mean differs from the others
- ANOVA is widely used across psychology, biology, social sciences, and medicine to analyze the effect of a single categorical variable on a continuous outcome (e.g., effect of different fertilizers on plant growth)
Components of the one-way ANOVA model
The model equation
The one-way ANOVA model decomposes each observation into three pieces:
where:
- is the -th observation in the -th group
- is the grand mean, the overall mean of the dependent variable across all observations regardless of group
- is the group effect for group , representing how far that group's mean deviates from the grand mean. A positive means the group mean sits above the grand mean; negative means below. For example, if the grand mean test score is 75 and school A averages 80, then .
- is the error term, capturing the random deviation of each individual observation from its own group mean. These errors are assumed to be normally distributed with mean zero and constant variance across all groups.
A key constraint is that the group effects sum to zero: (in the fixed-effects parameterization). This keeps the grand mean interpretable as the overall center.

Decomposing variability
The model splits total variability into two sources:
- Between-group variability (SSB): How much the group means differ from the grand mean. If the groups truly have different population means, this component will be large.
- Within-group variability (SSW): How much individual observations vary around their own group mean. This reflects noise or natural variation unrelated to group membership.
The F-statistic
The F-statistic compares these two sources of variability:
where is the number of groups and is the total number of observations.
- MSB (Mean Square Between) is the between-group sum of squares divided by its degrees of freedom
- MSW (Mean Square Within) is the within-group sum of squares divided by its degrees of freedom
A large F-value means the between-group differences are large relative to the noise within groups, which is evidence against the null hypothesis. For instance, an with would lead you to reject at the 0.05 significance level and conclude that at least one group mean differs.
Under , the F-statistic follows an -distribution with degrees of freedom.
Null and alternative hypotheses
The hypotheses for one-way ANOVA are:
- (all group population means are equal)
- At least one differs from the others
The alternative is non-directional. It doesn't tell you which group differs or in what direction. If you reject , you know something differs, but you'll need post-hoc tests (like Tukey's HSD) to identify the specific pairwise differences.
In some research contexts, a more targeted alternative like might be of interest, but that's handled through planned contrasts rather than the standard omnibus ANOVA F-test.
Assumptions of one-way ANOVA
Valid inference from ANOVA depends on three assumptions. Violating them can bias your results or inflate error rates, so you should always check them.

Independence
Observations within and across groups must be independent of each other. The value of one observation should not influence or be related to any other observation. This is primarily ensured by study design (random sampling, random assignment) rather than by a statistical test.
For example, if students in a classroom copy answers from each other, the independence assumption breaks down, and ANOVA results become unreliable.
Normality
The dependent variable should be approximately normally distributed within each group. You can assess this with:
- Histograms or Q-Q plots for each group
- Formal tests like the Shapiro-Wilk test
Moderate departures from normality are usually not a serious problem, especially when sample sizes are reasonably large and roughly equal across groups. ANOVA is fairly robust to non-normality in those conditions.
Homogeneity of variances (homoscedasticity)
The population variance of the dependent variable should be approximately equal across all groups. You can check this with:
- Levene's test (robust to non-normality, generally preferred)
- Bartlett's test (more powerful but sensitive to non-normality)
A common rule of thumb: if the ratio of the largest group variance to the smallest is less than about 3:1, standard ANOVA usually performs adequately.
When assumptions are violated
If assumptions don't hold, you have several options:
- Unequal variances: Use Welch's ANOVA, which doesn't assume equal variances, or apply a variance-stabilizing transformation (e.g., log transformation for right-skewed data)
- Severe non-normality: Consider the Kruskal-Wallis test, a non-parametric alternative that compares rank distributions rather than means
- Non-independence: This is the hardest to fix statistically. You may need a different model entirely (e.g., mixed-effects models for clustered data)