An ANOVA (analysis of variance) tests whether the means of several groups differ — for example: do three learning groups perform differently well on a test, or are the differences seen in the sample just random noise? With only two groups, a t-test would suffice. With three or more groups, you'd otherwise need many individual t-tests (A vs. B, A vs. C, B vs. C, …) — and with every additional test, the chance of finding a "significance" somewhere purely by chance increases, even though no real difference exists. ANOVA instead compares all groups together in a single test.
What does the F value measure?
Picture the group means on a number line. If they lie close together, the difference was probably chance. If they lie far apart — farther than you'd expect given the spread within each group — that speaks for a real effect. That's exactly what the F value measures: a ratio of "how different are the groups from each other" divided by "how much spread is there already within each individual group". A large F means: the differences between groups are large compared to the normal noise. From F and the degrees of freedom (which depend, among other things, on the number of groups and the sample size), the tool automatically computes the p-value — you don't need to keep a formula in your head for that.
What does this tool show?
Three tabs above: ① the one-way ANOVA (one factor, several groups), ② the two-way ANOVA (two factors at once, including interaction), and ③ a regression bridge: it shows, using the same data from ① and ②, that an ANOVA is at its core nothing other than a regression whose predictor is coded categorically (group membership instead of a numeric value) — just with its own name and its own table tradition. Regression is the more flexible variant here: it can combine categorical and continuous predictors in the same model — exactly what ANCOVA does, the direct analogue of ANOVA with an added continuous control variable.
Sliders in the sidebar
You set population means, spread and sample size on the left — the results table and plot react instantly. "Draw new sample" keeps the current slider settings but draws new random noise — so you can see how much the numbers move randomly from sample to sample, even though the underlying population stays the same.
Fix Y-axis
Active by default: the y-axis keeps the range that applied when the checkbox was last activated, instead of readjusting on every slider movement. This lets you see directly how, say, a larger spread (SD) affects the point cloud — without the plot automatically rescaling and "correcting away" the effect in the process. Disable it to go back to scaling automatically to the current data.
Highlight SS region
SS stands for Sum of (squared) deviations. Squaring is used because positive and negative deviations from the mean would otherwise cancel each other out — the plain sum of deviations otherwise always comes out to roughly zero. The checkbox highlights the two building blocks of this decomposition in color: between groups/cells (distance of the group/cell mean from the grand mean) and within (distance of each individual observation from its group/cell mean). Both checkboxes can be toggled independently of each other; the corresponding table rows stay permanently colored the same way, even when the graphic itself only shows the currently checked element. In the table, F and p are additionally highlighted in red as soon as an effect becomes significant (p < .05).
References
Fisher, R. A. (1925). Statistical Methods for Research Workers. Oliver & Boyd. Field, A. (2026). Discovering Statistics Using R and RStudio (2nd ed.). Sage.
Our Study
n = 20 per group
MControl = 100.0
MA = 107.0
MB = 114.0 F(2,57) = —
p = —
Population Parameters
μ Control100
μ Method A107
μ Method B114
SD (pooled)12
n per group20
Display
Highlight SS region (toggle independently):
Our Study
FA = —, p = — FB = —, p = — FA×B = —, p = —
Population Parameters
μ per cell (Factor A × Factor B):
no FB
with FB
Classic
100
108
Spaced
100
108
SD (pooled)12
n per cell15
Display
Highlight SS region (toggle independently):
Core Message
ANOVA and regression are the same linear model — only the coding of the group predictors differs. Dummy and effect coding yield exactly the same F and p values.
Note
This analysis uses the current samples from ① and ②. You'll find the sliders to change them on the respective tabs.
One factor, three groups — how much of the total spread does group membership explain?
📋 Example — Learning Program Comparison
A psychology department tests three variants of a learning program for the introductory statistics course. 60 first-year students are randomly assigned in equal parts (n = 20) to three groups, so that prior knowledge and motivation are on average evenly distributed and don't systematically correlate with group membership. The control group studies as usual with a script and flashcards in one session. Method A spreads the same amount of study time across several shorter sessions over two weeks (spaced practice). Method B mixes different task types during studying instead of working through them block by block (interleaving). Two weeks after the course ends, everyone takes the same memory test (0–150 points, higher = better recall). Question: do the three groups differ on average — and if so, by how much?
Picture the three group means on a number line. If they lie close together, the difference is probably chance (sampling noise). If they lie far apart — farther than you'd expect given the spread within each group — that speaks for a real effect of the factor. That's exactly the ratio the F value measures: variance between groups divided by variance within groups. On the left, under "Highlight SS region", you can make both building blocks visible in the plot individually — they can be toggled independently of each other.
Dots = individual observations (slightly offset so they don't overlap — the x position itself carries no information) · thick line = group mean · dashed line = grand mean
—
The ANOVA table
SSbetween measures how far the group means lie from the grand mean (weighted by group size). SSwithin measures the spread of the individual observations around their respective group mean — what a group difference cannot explain. Dividing by the respective degrees of freedom yields the mean squares (MS); their ratio MSbetween/MSwithin is the F value. η² = SSbetween/SStotal indicates what share of the total variance is explained by group membership.
Why comparing the SS isn't enough — what are the MS for?
SSbetween is a sum over k−1 terms (here: 2, one per group minus 1), SSwithin a sum over N−k terms (here: 57, one per observation minus the number of groups). That's a different number of summands — and with every additional summand, a sum of squares tends to grow further, regardless of whether an effect exists at all. A direct comparison of the raw sums SSbetween vs. SSwithin would therefore mainly reflect how many degrees of freedom went into each sum — not how strong the group difference really is. Only dividing by the respective df "normalizes" both sums to an average squared deviation per degree of freedom — a variance estimate. These two variance estimates (MSbetween and MSwithin) are, under H₀ (no real effect), equal in expectation, which corresponds to F = 1 (numerator and denominator are the same size). Their ratio then follows a known distribution, the F distribution — that's the basis for the significance test. Without dividing by df, there would be no distribution to compare against.
Concepts & Context
"Within" = error variance
SSwithin and MSwithin are usually called MSerror in tables and software (also residual) — the same quantity, a different name. What's meant is the spread that remains after accounting for group membership: individual differences, measurement imprecision, everything the model can't explain. "Error" here doesn't mean "measurement error" in the narrow sense, but unexplained spread treated as random — the remainder that group membership doesn't account for.
SS and MS at a glance
SSbetween + SSwithin = SStotal — the total spread decomposes completely into an explained and an unexplained part. MS = SS/df turns these into comparable variance estimates; F = MSbetween/MSwithin is the ratio of explained to unexplained variance per degree of freedom.
η² as an effect size
η² = SSbetween/SStotal answers a different question than p: not "is there an effect?", but "how large is it, relative to the total spread?". A tiny but significant effect (large n) can have a small η² — and vice versa. Context alongside Cohen's d, r and odds ratio: → Effect Sizes.
Two factors, four cells — does Factor A have an effect, does Factor B, and does the effect of one depend on the other?
📋 Standalone Example — Learning Method × Feedback
To illustrate the interaction, we deliberately reduce here to two learning methods instead of the three from Tab ① — Classic and Spaced Learning — and cross them with a second factor: feedback (without / with immediate feedback after each study unit). Four cells, balanced design (same cell size n per cell). The population values here are chosen independently of Tab ① — both tabs can be operated independently of each other.
What does an interaction actually mean?
Besides the two main effects (does A have an effect on average across both levels of B? does B have an effect on average across both levels of A?), the interaction is of interest: does the effect of the combination of method and feedback deviate from what the sum of the two main effects would predict? Without an interaction, the effects are additive — the feedback effect is the same size for both methods, so you can simply add it to the main effect of method. With an interaction, this can no longer be separated: the effect of feedback differs depending on the method, and you have to look at the four cell means individually to understand what's happening.
Additive — no interaction
no FB
with FB
Classic
100
108
Spaced
100
108
Feedback effect = +8, identical for both methods → two parallel lines in the plot.
With interaction
no FB
with FB
Classic
100
102
Spaced
100
120
Feedback effect = +2 for Classic, +20 for Spaced → differently steep, diverging lines in the plot.
If the lines even cross in the process (feedback helps for one method but hurts for the other), that's called a disordinal interaction — the direction of the effect reverses. If the lines only diverge to different degrees without crossing (as in the example above right), it's an ordinal interaction — the direction stays the same, only the strength differs. Both forms are statistically "interaction", but need to be interpreted very differently in substantive terms.
Tutorial — try it out: The sliders on the left are preset so that only a main effect of feedback exists (with FB is higher for both methods equally), but no main effect of learning method and no interaction. Now deliberately change exactly one cell — e.g. in the 2×2 slider grid on the left, the bottom-right one (row "Spaced", column "with FB") clearly upward. Observe: the interaction becomes significant (the F/p values in the table below turn red), while the main effect of learning method often remains not significant — because main effects average across the respective other factor level, and a change in just one cell partially cancels out in that average, even though it very much makes a difference locally.
x-axis: Factor A (learning method) · line color: Factor B (feedback) · small dots = individual observations · error bars: ±1 SE
—
Why this works out so smoothly only for balanced designs
With equal cell size n, the three effects (A, B, interaction) are statistically independent of each other — which is why each can be considered on its own, without "partialling out" the others. This no longer holds for unbalanced cell sizes — more on that in Tab ③ and the concept cards there. Continuous instead of categorical interactions are covered by → Moderation Analysis.
Concepts & Context
"Within cells" = error variance
Just as in Tab ①, SSwithin/MSwithin is often called MSerror in tables — the spread within the four cells, pooled across all four. It keeps playing the same role regardless of whether one or two factors are in the model: what remains as spread after accounting for all cell memberships, and is treated as random. All three F-tests (A, B, interaction) share the same MSerror in the denominator.
Main effect vs. interaction
A main effect is a mean across the levels of the respective other factor — it can be misleading when an interaction is present (see the tutorial above: only one cell changes, but the averaged main effects remain unremarkable). So the rule of thumb is: always check the interaction first. If it's significant, main effects alone are often no longer meaningfully interpretable — then it's worth looking at the individual cell means instead of the marginal means.
Ordinal vs. disordinal
With an ordinal interaction, the rank order of the levels stays the same across the other factor — only the distance changes (lines diverge but don't cross). With a disordinal (crossover) interaction, the direction reverses — what helps at one level hurts at the other. Disordinal interactions are practically usually the more interesting ones, because they mean: there's no across-the-board "best" level, it depends.
Related tools
The same analysis as regression with a product term: → Tab ③ Regression Bridge. Continuous instead of categorical interactions (e.g. age instead of learning method): → Moderation Analysis. Factors with random instead of fixed levels (e.g. school classes): → Multilevel Models.
Regression Bridge: Same Analysis, Different Coding
Exactly the same samples from ① and ②, computed once more as multiple regression.
An ANOVAis a multiple regression whose categorical predictor has been numerically coded in a particular way. This can be verified directly: the same raw data, once analyzed with the classic ANOVA formula (Tabs ① and ②), once as a regression with coded group predictors — and both yield exactly the same F and p values.
One-way: dummy vs. effect coding
Two common coding schemes in direct comparison: dummy coding (one reference group, coefficients = mean differences to the reference) and effect coding (sum-to-zero contrasts, coefficients = deviations from the grand mean). Both models have three free parameters for three groups — they are "saturated" and reproduce the three group means from Tab ① exactly, regardless of the coding.
Dummy coding (reference: Control)
Effect coding (sum-to-zero contrasts)
—
One parametrization, not two procedures
F, p, R² and the predicted group means are identical in both codings — only the meaning of the individual coefficients changes. R² of this regression is, incidentally, identical to η² from Tab ①: the same quantity, computed twice.
Two-way: dummy vs. effect coding (with interaction)
The same two coding schemes as above, now with a second factor and a product term for the interaction. Dummy coding sets a reference cell (here: Classic, no feedback); effect coding codes both factors as ±1 contrasts. Both models have four free parameters for four cells — saturated here too, both reproduce the four cell means from Tab ② exactly, regardless of the coding.
Dummy coding (reference: Classic, no feedback)
Effect coding (±1 contrasts)
—
The same computation is called "moderation analysis" elsewhere
The product-term regression above is a moderation analysis: XA·XB is exactly the interaction/moderation term, and the F-test on it answers the same question as in Tab ②: does the effect of A depend on the level of B (and vice versa)? It's not "ANOVA versus moderation analysis" — it's the same model with two vocabularies for the same building blocks: Factor A and Factor B (ANOVA) are called predictor and moderator in moderation language, and the interaction A×B is called an interaction term or moderation effect there. A "main effect" has no dedicated counterpart in moderation language — what's meant there is simply the effect of the predictor or moderator by itself, at a fixed (usually average) value of the respective other. The practical difference lies only in what each vocabulary is typically used for: the classic ANOVA computation assumes categorical factors, while the more general moderation analysis can freely mix and combine nominal and continuous predictors — e.g. learning method (categorical) × prior-knowledge test score (continuous) instead of learning method × feedback yes/no. More on this, including continuous-moderator plots: → Moderation Analysis.
Concepts & Context
Dummy vs. effect coding
Dummy coding (R calls it "treatment contrasts") sets a reference group; coefficients are mean differences to this reference. Effect coding (sum-to-zero contrasts) sets no fixed reference point; coefficients are deviations from the grand mean, as implicitly used by SPSS and most ANOVA outputs. Both are reparametrizations of the same model — identical predictions, identical F, identical p.
Type I (sequential): each term is tested only controlling for the previously entered terms — order-dependent. Type II: each main effect controlling for all other main effects, but without higher-order interactions. Type III: each term controlling for all other terms including interactions — what the effect-coded regression delivers. For balanced designs, all three are identical (Tab ②); for unbalanced ones, they diverge.
Type-III SS ≡ classic ANOVA table
For a balanced design like this one, the effect-coded regression yields exactly the same SS and F as the classic ANOVA formula from Tab ② — for every term. Reason: the three contrast columns (XA, XB, XA·XB) are mutually orthogonal for equal cell size n. This no longer holds for unbalanced cell sizes — see the "SS Type I, II, III" flashcard.
ANOVA table: anatomy
SS (Sum of Squares) = spread in squared units of the DV. df = degrees of freedom. MS = SS/df, a variance estimate. F = MSeffect/MSerror, compared against the F distribution under H₀ (no effect). The same logic as the F-test on R² increase in regression — just with ANOVA-typical vocabulary for the sources of variance.
η² and partial η²
η² = SSeffect/SStotal, identical to R² of the equivalent regression for a one-way ANOVA. For multi-factor designs, partialη² = SSeffect/(SSeffect+SSerror) is usually reported instead. Context alongside Cohen's d, r and odds ratio: → Effect Sizes.
When ANOVA, when regression?
It's not a substantive decision, but a question of reporting convention and software habit — because the procedures are nested special cases of one another. A t-test is an ANOVA with only two groups. An ANOVA, in turn, is a regression with one or more categorical dummy predictors. And regression itself is only a special case of the general linear model (GLM) — which, once nested or repeatedly measured data enter the picture (e.g. school classes, repeated measures), extends up to the generalized/mixed model (GLMM).