Unit 10 · Factorial designs

How to run a two-way ANOVA in SPSS

Run a two-way between-subjects ANOVA in SPSS, interpret main effects and interactions, and read profile plots.

Free tutorialPro practiceAbout 5 minutes6 practice questions

Quick answer: How do you run a two-way ANOVA in SPSS?

  1. Click Analyze › General Linear Model › Univariate.
  2. Move the outcome into Dependent Variable and both grouping variables into Fixed Factor(s).
  3. Under Plots… add a profile plot; under Options… tick Estimates of effect size.
  4. Click OK and read the interaction row first.

Report it in APA style: There was a significant caffeine × sleep interaction, F(1, 76) = 5.00, p = .028, ηp² = .06.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

What is a two-way ANOVA?

A two-way (factorial) ANOVA tests two grouping variables at once, such as caffeine and sleep. It gives three results: the main effect of each factor and their interaction, which tells you whether the effect of one factor depends on the level of the other.

When to use it

  • Two between-subjects factors, each with two or more levels.
  • Every combination of levels (each cell) contains different people.
  • A Scale outcome.

How it works

A main effect compares the levels of one factor averaged over the other factor. An interaction means the lines on a profile plot aren’t parallel: for example, sleep loss slows reaction times a lot without caffeine but only a little with it. Interpret a significant interaction first, often with simple effects (the effect of one factor at each level of the other), because main effects can mislead when an interaction is present. Partial eta squared gives an effect size for each effect.

Assumptions

  • Scale outcome, roughly normal in each cell.
  • Independent observations.
  • Equal variances across cells (Levene’s test).
  • Reasonably balanced cell sizes help.

Worked example

There was a significant caffeine × sleep interaction, F(1, 76) = 5.00, p = .028, ηp² = .06: sleep deprivation added 60 ms to reaction time without caffeine but only 30 ms with it.

Key terms

Factorial design
A design that crosses two or more factors.
Main effect
The effect of one factor averaged over the others.
Interaction
When one factor’s effect depends on another factor.
Simple effects
The effect of one factor at a single level of another.

Common mistakes

  • Interpreting main effects without checking the interaction.
  • Reading non-parallel lines on a plot as an interaction without the significance test.

How to do it in SPSS

The Univariate dialog

Two-way ANOVA tests two grouping variables at once, and whether they interact. Example: does caffeine change how much sleep loss slows reaction time?

Univariate
Variables
Participant ID [id]
Age in years [age]
▶
Dependent Variable:1
Reaction time ms [rt]
▶
Fixed Factor(s):2
Caffeine [caffeine]
Sleep [sleep]
▶
Covariate(s):
Model…Contrasts…Plots…3Post Hoc…EM Means…Save…Options…4
OKPasteResetCancelHelp
  1. 1
    Dependent VariableThe Scale outcome: reaction time.
  2. 2
    Fixed Factor(s)Both grouping variables. SPSS automatically tests each one and their interaction.
  3. 3
    Plots…Put sleep on the Horizontal Axis and caffeine in Separate Lines, then click Add. This draws the interaction.
  4. 4
    Options…Tick Descriptive statistics, Estimates of effect size and Homogeneity tests.

Reading two-way ANOVA output

Three effects to read: each factor on its own (main effects) and the two together (interaction). Start with the interaction.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
Univariate Analysis of Variance
Levene's Test
Tests of Between-Subjects Effects
Profile Plots
Tests of Between-Subjects Effects · Dependent Variable: rt
SourceType III Sum
of Squares
dfMean
Square
FSig.Partial Eta
Squared
Corrected Model57500.00319166.6721.30.000.457
caffeine112500.00112500.0013.89.000.155
sleep240500.00140500.0045.00.000.372
caffeine * sleep34500.0014500.005.00.028.062
Error68400.0076900.00
Corrected Total125900.0079

Cell means (ms, n = 20): no caffeine 300 rested / 360 deprived · caffeine 290 rested / 320 deprived

Profile Plot · Estimated Marginal Means of rt4
RestedSleep-deprivedNo caffeineCaffeineRT
  1. 1
    Main effect of caffeineAveraged over sleep, caffeine made people faster, F(1, 76) = 13.89, p < .001.
  2. 2
    Main effect of sleepSleep-deprived people were slower overall, F(1, 76) = 45.00, p < .001.
  3. 3
    InteractionSignificant, F(1, 76) = 5.00, p = .028: the effect of sleep depends on caffeine.
  4. 4
    Profile plotLines that aren’t parallel signal an interaction. Sleep loss added 60 ms without caffeine but only 30 ms with it.

When the interaction is significant, describe it first. Main effects on their own can be misleading.

The SPSS syntax

Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.

UNIANOVA rt BY caffeine sleep
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(sleep*caffeine)
  /PRINT=ETASQ DESCRIPTIVE HOMOGENEITY
  /DESIGN=caffeine sleep caffeine*sleep.

Practice data

Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.

  • caffeine.savReaction times by caffeine and sleep condition (N = 80)

Now practise it interactively →

Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 6 quick questions, with instant feedback on every answer.

Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.

More in Factorial designs