One-Way ANOVA & the F-Ratio
Info sheet · Statistics for Psychology & Neuroscience
Warning✎ Editing notes — to do / to check
Working notes for the author — not shown to students once collapsed; remove before publishing.
- [ ]
What you’ll get from this sheet
By the end you should be able to:
- Say what a one-way ANOVA is testing.
- Explain the F-ratio — and why it’s a ratio of two variances.
- Run a one-way ANOVA in R, Python, or MATLAB.
A one-way ANOVA weighs the variance between the group means against the variance within the groups. That ratio is the F-ratio — big when the groups are well separated relative to their noise, small when they aren’t.
What ANOVA is doing
ANOVA — analysis of variance — is a relatively old test, developed by Ronald Fisher around a century ago. We use it to test for differences in the means of two, but usually more than two, groups. It’s built around the F-ratio, which is simply the ratio of the variance between the different groups to the variance within each group.
The intuition is nicer than the name suggests. If the variance between the groups is a lot bigger than the variance within them — the group means are spread far apart compared to how noisy each group is — then the F-ratio is large, and we start to believe the groups really differ. If the between-group variance is about the same as the within-group variance, the F-ratio is small (around 1), and we’ve got nothing.
One important catch: ANOVA is an omnibus test. A significant result tells you that at least one group mean differs from the others — but it does not tell you which ones. For that you need follow-up comparisons (post-hoc tests or planned contrasts).
Build your own F
Below are three groups of data. Drag the two sliders and watch the F-ratio respond:
- Separation pushes the three group means apart (more between-group variance → bigger F).
- Within-group spread adds noise inside each group (more within-group variance → smaller F).
The orange bars are the group means; the green dashed line is the grand mean.
Notice the two ways to make F small: shove the means back together (less signal), or crank up the within-group spread (more noise). That’s the whole game — signal measured against noise.
See it in code
A one-way ANOVA on three small groups. In the book we run this on the Decade of Dance data with aov(danceability ~ decade, data = dataset), but the machinery is the same:
score = [52 55 48 50 61 58 63 60 70 66 72 69];
group = [1 1 1 1 2 2 2 2 3 3 3 3];
[p, tbl, stats] = anova1(score, group); % F and p in the ANOVA tableStatic reference — the R and Python tabs run live in the page.
TipCheck your understanding
Your ANOVA comes back with F ≈ 0.9. What does that tell you?
An F around 1 means the between-group variance is about the same as the within-group variance — the group means are no more spread out than you’d expect from the noise alone. There’s no evidence the groups differ. (And even a large, significant F only says at least one mean differs — not which.)
ANOVA is an omnibus test: a significant F does not tell you which groups differ — chasing that down needs post-hoc tests or planned contrasts. And with a big enough sample, a trivially small difference can be “significant,” so always report an effect size (like η²) alongside F.
Where this shows up next
This is the foundation for everything in Chapter 8 (ANOVA) — the assumptions you need to check, the post-hoc tests and planned contrasts that follow a significant result, and the factorial designs that add more factors.