In brief
- Use a one-way ANOVA for one categorical factor with three or more independent groups and one continuous outcome.
- Use a two-way ANOVA for two categorical factors; it tests two main effects and their interaction.
- Both assume independent observations, roughly normal residuals and similar group variances.
- A significant interaction means the effect of one factor depends on the level of the other, so interpret simple effects first.
- Report F with both degrees of freedom, the exact p value and an effect size such as eta squared or partial eta squared.
One-way vs two-way ANOVA: the short answer ¶
The difference between one-way and two-way ANOVA is the number of independent variables (factors). A one-way ANOVA tests whether the means of three or more groups defined by one factor differ. A two-way ANOVA tests the effects of two factors on one continuous outcome at the same time, plus their interaction.
| Feature | One-way ANOVA | Two-way ANOVA |
|---|---|---|
| Factors (independent variables) | One, with 2 or more levels | Two, each with 2 or more levels |
| Dependent variable | One continuous variable | One continuous variable |
| Null hypotheses tested | One: all group means are equal | Three: no main effect of A, no main effect of B, no A × B interaction |
| Interaction effect | Not possible | Tested directly |
| Example question | Do exam scores differ by study technique? | Do exam scores differ by technique and course format, and does the technique effect depend on format? |
| SPSS menu | Analyze > Compare Means > One-Way ANOVA | Analyze > General Linear Model > Univariate |
If you have only two groups and one factor, a one-way ANOVA gives the same p value as an independent-samples t-test (F equals t squared).
What is a one-way ANOVA? ¶
A one-way analysis of variance (ANOVA) compares the means of k independent groups. Its null hypothesis is that all population means are equal (H0: μ1 = μ2 = ... = μk); the alternative is that at least one mean differs.
One-way ANOVA formula
The test splits the total variation into variation between groups and variation within groups:
SS_between = Σ n_j (mean_j - grand mean)^2, with df = k - 1SS_within = Σ Σ (x_ij - mean_j)^2, with df = N - kMS = SS / dfF = MS_between / MS_within
If the group means are far apart relative to the spread inside each group, F is large and p is small. The effect size is eta squared: η² = SS_between / SS_total.
When to use a one-way ANOVA
- One categorical independent variable (for example, three teaching methods).
- One continuous dependent variable measured on an interval or ratio scale.
- Different participants in each group (for the same participants measured repeatedly, use repeated-measures ANOVA).
What is a two-way ANOVA? ¶
Always plot the cell means before reading the F table. Non-parallel lines tell you where to look.
A two-way (two-factor) ANOVA examines two categorical independent variables together. In a 3 × 2 design, for example, Factor A has three levels and Factor B has two, giving six cells. It answers three questions:
- Main effect of A: Do the means differ across levels of A, averaging over B?
- Main effect of B: Do the means differ across levels of B, averaging over A?
- A × B interaction: Does the effect of A change depending on the level of B?
A two-way ANOVA has two practical advantages over running two separate one-way ANOVAs. It tests the interaction, and it removes the variance explained by the second factor from the error term, which usually gives more statistical power. You will see this in the worked example below.
Interaction effects explained
An interaction exists when the lines on a means (profile) plot are not parallel. Imagine a new study technique that raises scores by 9 points in face-to-face classes but by only 1 point online. Saying that the technique works by an average of 5 points would hide the real pattern. When the interaction is significant, interpret the simple effects (the effect of one factor at each level of the other) before, or instead of, the main effects.
SPSS Help
Running an ANOVA in SPSS? Check your assumptions, post hoc tests and APA write-up with a statistician who explains every table.
ANOVA assumptions and what to do if they fail ¶
One-way and two-way between-subjects ANOVA share the same assumptions.
| Assumption | How to check | If violated |
|---|---|---|
| Independence of observations | Design: each participant appears in one cell only | Use repeated-measures or mixed models |
| Normality of residuals within groups | Q-Q plot of residuals; Shapiro-Wilk with small samples | ANOVA is fairly robust with similar, moderate group sizes; consider transformation or Kruskal-Wallis (one-way only) |
| Homogeneity of variance | Levene's test; compare group SDs | One-way: report Welch's F and use Games-Howell post hoc tests. Two-way: aim for equal cell sizes, consider robust standard errors |
| No extreme outliers | Boxplots, standardized residuals beyond ±3 | Check for data entry errors; report sensitivity analyses |
Unequal group sizes make the homogeneity assumption more important. With unbalanced two-way designs, SPSS uses Type III sums of squares by default, which is the usual choice when an interaction term is in the model.
Worked example: one-way and two-way ANOVA on the same data ¶
Thirty students were randomly assigned to one of three study techniques (rereading, practice testing, concept mapping) and to one of two course formats (online, in person), with 5 students per cell. The outcome is an exam score out of 100.
Cell means (SD), n = 5 per cell
| Technique | Online | In person | Technique mean |
|---|---|---|---|
| Rereading | 63.0 (3.2) | 67.0 (2.6) | 65.0 |
| Practice testing | 80.0 (3.8) | 81.0 (3.4) | 80.5 |
| Concept mapping | 66.0 (3.7) | 75.0 (2.6) | 70.5 |
| Format mean | 69.7 | 74.3 | 72.0 |
One-way ANOVA table (technique only)
| Source | SS | df | MS | F | p |
|---|---|---|---|---|---|
| Between groups | 1235.00 | 2 | 617.50 | 33.41 | <.001 |
| Within groups | 499.00 | 27 | 18.48 | ||
| Total | 1734.00 | 29 |
Eta squared = 1235 / 1734 = .71. Levene's test was not significant, F(2, 27) = 1.96, p = .161.
Two-way ANOVA table (technique × format)
| Source | SS | df | MS | F | p | Partial η² |
|---|---|---|---|---|---|---|
| Technique | 1235.00 | 2 | 617.50 | 58.35 | <.001 | .83 |
| Format | 163.33 | 1 | 163.33 | 15.43 | <.001 | .39 |
| Technique × Format | 81.67 | 2 | 40.83 | 3.86 | .035 | .24 |
| Error | 254.00 | 24 | 10.58 | |||
| Corrected total | 1734.00 | 29 |
Check the arithmetic: 1235.00 + 163.33 + 81.67 + 254.00 = 1734.00. The one-way error term (499) contained the format and interaction variation (163.33 + 81.67 + 254.00). Moving them out of the error term cut the mean square error from 18.48 to 10.58, so the technique F rose from 33.41 to 58.35.
Interpreting the interaction
The interaction is significant, so we test simple effects of format within each technique (pooled error, df = 1, 24). In-person students scored 9 points higher with concept mapping, F(1, 24) = 19.13, p < .001; 4 points higher with rereading, F(1, 24) = 3.78, p = .064; and 1 point higher with practice testing, F(1, 24) = 0.24, p = .631. Practice testing worked well in both formats; concept mapping depended on the format.
One-way ANOVA A one-way ANOVA showed that [DV] [differed/did not differ] across [factor] groups, F([df between], [df within]) = [F], p = [p], η² = [value]. [Post hoc test] comparisons indicated that [group A] (M = [mean], SD = [SD]) scored [higher/lower] than [group B] (M = [mean], SD = [SD]), p = [p]. Two-way ANOVA A [levels A] × [levels B] between-subjects ANOVA showed [a significant/no significant] main effect of [factor A], F([df], [df error]) = [F], p = [p], partial η² = [value], [a significant/no significant] main effect of [factor B], F([df], [df error]) = [F], p = [p], partial η² = [value], and [a significant/no significant] [A] × [B] interaction, F([df], [df error]) = [F], p = [p], partial η² = [value]. [If significant: Simple effects showed that ...]
Post hoc tests after ANOVA ¶
A significant F tells you that at least one mean differs, not which ones. Post hoc tests compare pairs while controlling the familywise error rate.
- Tukey HSD: the standard choice for all pairwise comparisons with equal variances.
- Games-Howell: use when variances or group sizes are unequal.
- Bonferroni: simple and conservative; good for a small set of planned comparisons.
- Scheffé: very conservative; suited to complex contrasts.
- Dunnett: compares each group with a single control group.
Tukey HSD for technique (one-way model)
- Practice testing vs rereading: difference = 15.5, p < .001
- Practice testing vs concept mapping: difference = 10.0, p < .001
- Concept mapping vs rereading: difference = 5.5, p = .021
In a two-way design with a significant interaction, main-effect post hoc tests can mislead, because they average over the other factor. Report simple effects (with a Bonferroni adjustment) instead.
How to run one-way and two-way ANOVA in SPSS ¶
One-way ANOVA in SPSS
- Go to Analyze > Compare Means > One-Way ANOVA.
- Move the outcome to Dependent List and the grouping variable to Factor.
- Click Post Hoc and tick Tukey (and Games-Howell as a backup if variances may differ).
- Click Options and tick Descriptive, Homogeneity of variance test, Welch and Means plot.
- In version 27 and later, tick Estimate effect size for overall tests to get eta squared. Click OK.
Two-way ANOVA in SPSS
- Go to Analyze > General Linear Model > Univariate.
- Move the outcome to Dependent Variable and both factors to Fixed Factor(s).
- Click Plots, put one factor on Horizontal Axis and the other on Separate Lines, then Add.
- Click Post Hoc for any factor with three or more levels and tick Tukey.
- Click Options and tick Descriptive statistics, Estimates of effect size and Homogeneity tests.
- For simple effects, click Paste and add a COMPARE subcommand, as below, then run the syntax.
UNIANOVA score BY technique format
/METHOD=SSTYPE(3)
/PLOT=PROFILE(technique*format)
/POSTHOC=technique(TUKEY)
/EMMEANS=TABLES(technique*format) COMPARE(format) ADJ(BONFERRONI)
/PRINT=ETASQ DESCRIPTIVE HOMOGENEITY
/DESIGN=technique format technique*format.
If the output does not match what you expected, our SPSS help service can review your setup and output with you and explain each table so you can report it confidently.
How to report ANOVA results in APA style ¶
APA 7 italicizes statistical symbols (F, p, M, SD), reports F and effect sizes to two decimals, drops the leading zero for p and η², and writes very small p values as p < .001. Give both degrees of freedom in parentheses.
One-way ANOVA, APA 7
A one-way ANOVA showed that exam scores differed by study technique, F(2, 27) = 33.41, p < .001, η² = .71. Tukey HSD tests indicated that practice testing (M = 80.5, SD = 3.4) produced higher scores than concept mapping (M = 70.5, SD = 5.6), p < .001, and rereading (M = 65.0, SD = 3.5), p < .001. Concept mapping also outperformed rereading, p = .021.
Two-way ANOVA, APA 7
A 3 × 2 between-subjects ANOVA revealed significant main effects of technique, F(2, 24) = 58.35, p < .001, partial η² = .83, and format, F(1, 24) = 15.43, p < .001, partial η² = .39, qualified by a significant Technique × Format interaction, F(2, 24) = 3.86, p = .035, partial η² = .24. Simple effects showed that the in-person advantage was significant for concept mapping (p < .001) but not for rereading (p = .064) or practice testing (p = .631).
For the table itself, follow our APA table format guide. To build a model with continuous predictors instead of groups, see the regression equation guide, or book statistics tutoring to work through your own design.