ANOVA Simulator: Compare Means Across Groups

simulator intermediate ~10 min
Loading simulation...
F ≈ 6.2, p < 0.01 — significant group differences

With three groups (means 100, 108, 115), within-group σ=15, and n=20 per group, the one-way ANOVA yields F ≈ 6.2, indicating significant differences between group means.

Formula

F = MS_between / MS_within
MS_between = SS_between / (k - 1), where k = number of groups
MS_within = SS_within / (N - k)
η² = SS_between / SS_total

Comparing More Than Two Groups

Analysis of Variance, developed by Ronald Fisher in the 1920s, is the workhorse of experimental science. Whenever researchers need to compare outcomes across three or more conditions — drug dosages, teaching methods, fertilizer types — ANOVA provides the rigorous framework. Despite its name emphasizing variance, ANOVA is fundamentally about comparing means. The key insight is that you can detect mean differences by decomposing total variation into between-group and within-group components.

The F-Ratio: Signal vs. Noise

The F-statistic is a signal-to-noise ratio. The numerator (between-group variance) measures how much the group means differ from each other — the signal. The denominator (within-group variance) measures how much individual observations vary within their groups — the noise. When groups truly have different means, the between-group variance will be inflated relative to the within-group variance, producing a large F value.

Assumptions and Robustness

One-way ANOVA assumes normally distributed data, equal variances across groups (homoscedasticity), and independent observations. Fortunately, ANOVA is quite robust to violations of normality, especially with larger samples. Unequal variances are more problematic — when group variances differ substantially, Welch's ANOVA provides a more reliable alternative. The independence assumption, however, is crucial and cannot be bypassed.

After ANOVA: Post-Hoc Tests

A significant F-test tells you that at least one group mean differs, but not which groups differ from which. Post-hoc tests like Tukey's Honestly Significant Difference (HSD) perform all pairwise comparisons while controlling the family-wise error rate. This simulator focuses on the omnibus F-test — the first step in any ANOVA analysis — and visualizes how the balance between signal and noise determines statistical significance.

FAQ

What is ANOVA and when should I use it?

ANOVA (Analysis of Variance) tests whether the means of three or more groups are equal. Use it when you have one categorical independent variable (the grouping factor) and one continuous dependent variable. For example, comparing test scores across three teaching methods, or crop yields across four fertilizer types.

Why not just do multiple t-tests instead of ANOVA?

Running multiple t-tests inflates the Type I error rate. With 3 groups, you'd need 3 comparisons, giving a family-wise error rate of about 14% instead of 5%. ANOVA controls this by using a single omnibus test. If significant, you then use post-hoc tests (like Tukey's HSD) that correct for multiple comparisons.

What does the F-statistic measure?

The F-statistic is the ratio of between-group variance to within-group variance. A large F means groups differ more than you'd expect from random variation alone. F = 1 means between-group and within-group variance are equal, consistent with no real group differences.

What is eta-squared and how do I interpret it?

Eta-squared (η²) is the proportion of total variance explained by the grouping variable. It ranges from 0 to 1. Conventional benchmarks: η² ≈ 0.01 is small, 0.06 is medium, 0.14 is large. It tells you the practical importance of group differences, complementing the p-value's statistical significance.

Sources

Embed

<iframe src="https://homo-deus.com/lab/statistics/anova/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub