One-Way ANOVA
Hypothesis TestingTests whether the means of three or more independent groups differ significantly by partitioning total variance into between-group and within-group components.
When to Use
Use this test when you have a continuous outcome measured across three or more independent groups and want to determine whether at least one group mean differs from the others. For example, comparing tumour volume across three drug treatment groups, or comparing exam scores across four teaching methods.
Assumptions
- The dependent variable is continuous.
- Observations are independent both within and between groups.
- The dependent variable is approximately normally distributed within each group.
- Homogeneity of variances across groups (assessed by Levene's test). When violated, consider Welch's ANOVA or a non-parametric alternative.
Required Inputs
| Input | Type | Notes |
|---|---|---|
| Groups | Numeric (multiple columns) | Two or more columns of values, each representing one group |
Output Metrics
| Metric | What it means |
|---|---|
| Source | Source of variation: Model (between-groups), Error (within-groups), or Corrected Total. |
| DF | Degrees of freedom for each source. |
| Sum of Squares | Sum of squared deviations for each source. |
| Mean Square | Sum of squares divided by degrees of freedom. |
| F Value | Ratio of between-group mean square to within-group mean square. |
| Pr > F | P-value for the overall F-test. |
| Eta-Squared | Proportion of total variance explained by group membership. Thresholds: small (0.01), medium (0.06), large (0.14). |
| Omega-Squared | Less biased estimate of explained variance than eta-squared. |
| LS Means | Least-squares (adjusted) mean for each group. |
| LS Means — Std Error | Standard error for each least-squares mean. |
| LS Means — 95% CL Lower | Lower confidence limit for each least-squares mean. |
| LS Means — 95% CL Upper | Upper confidence limit for each least-squares mean. |
| Mean Diff | Difference between each pair of group means in post-hoc comparisons. |
| Std Error (Post-Hoc) | Standard error for each post-hoc pairwise mean difference. |
| t Value (Post-Hoc) | t statistic for each post-hoc pairwise comparison. |
| Pr > |t| (Post-Hoc) | Adjusted p-value for each pairwise comparison (Tukey, Bonferroni, or other method). |
| Levene's F | Levene's test statistic for homogeneity of variances. |
| Levene's Pr > F | P-value for Levene's test. If significant, variances are unequal. |
Interpretation
- A significant F-test (Pr > F < alpha) means at least one group mean differs from the others, but it does not tell you which groups differ.
- Post-hoc pairwise comparisons (e.g., Tukey HSD) identify which specific group pairs differ significantly.
- Eta-squared tells you what proportion of the total variation in the outcome is attributable to group membership: small (0.01), medium (0.06), large (0.14).
- Always report effect size alongside the p-value. A significant p-value with a tiny effect size may not be practically meaningful.
- If Levene's test is significant, the homogeneity assumption is violated. Consider using Welch's ANOVA or report results with caution.
Common Pitfalls
- ANOVA is an omnibus test. A significant result only tells you that groups differ somewhere; you must run post-hoc tests to find where.
- Multiple comparisons inflate the Type I error rate. Always use a correction method (Tukey, Bonferroni, Holm) for post-hoc tests.
- Unequal group sizes combined with unequal variances can severely distort the F-test. Check Levene's test and consider alternatives if violated.
- ANOVA assumes independence. Repeated measurements from the same subjects require repeated-measures ANOVA, not one-way ANOVA.
How It Works
- Compute the grand mean (mean of all observations) and each group mean.
- Calculate the between-group sum of squares (how much group means deviate from the grand mean) and the within-group sum of squares (how much individual observations deviate from their group mean).
- Divide each sum of squares by its degrees of freedom to get mean squares.
- Compute the F-ratio as between-group mean square / within-group mean square. Compare F to the F-distribution to obtain the p-value.
Citations
References
- Fisher, R. A. (1925). Statistical Methods for Research Workers. Oliver & Boyd.
- Tukey, J. W. (1949). Comparing individual means in the analysis of variance. Biometrics, 5(2), 99-114.
- Levene, H. (1960). Robust tests for equality of variances. In Contributions to Probability and Statistics (pp. 278-292). Stanford University Press.