Two-Way Repeated-Measures ANOVA in SPSS: Step-by-Step

What Is a Two-Way Repeated-Measures ANOVA?

A two-way repeated-measures ANOVA tests whether two within-subjects factors — and the interaction between them — affect a continuous outcome, when the same participants are measured under every combination of conditions. If you have already run a one-way repeated-measures ANOVA, this is the natural next step: it adds a second repeated factor so you can ask not only “does each factor matter on its own?” but also “does the effect of one factor depend on the level of the other?”

A classic example: the same 24 participants complete a reaction-time task under three caffeine conditions (none, low dose, high dose) at two times of day (morning and evening). That gives you two within-subjects factors — caffeine (3 levels) and time of day (2 levels) — and six measurements per person. A two-way repeated-measures ANOVA tells you whether caffeine affects reaction time, whether time of day affects it, and, most interestingly, whether caffeine’s effect is different in the morning than in the evening. That last question is the interaction, and it is usually the reason researchers choose this design.

This tutorial walks through the full analysis in SPSS: setting up the data, running the test through the menus, reading every part of the output, and reporting the results in APA style (7th ed.). A paste-ready syntax block is included so you can reproduce the whole analysis in one step.

When to Use a Two-Way Repeated-Measures ANOVA

Use this test when all of the following are true:

  • Two within-subjects factors. Every participant is measured at every level of both factors. If one factor is between-subjects (different people in each group), you need a mixed ANOVA instead — that is a different design with a different menu route.
  • A continuous dependent variable. Reaction time, test scores, blood pressure, or any scale-level outcome measured on the same scale at each time point.
  • Related measurements. The repeated measurements come from the same people, so the scores in different cells are correlated. That correlation is what the repeated-measures design exploits — and why an ordinary two-way ANOVA on the same data would be wrong.

Before running the test, check the assumptions: the dependent variable should be approximately normally distributed within each combination of conditions (check the residuals, not the raw scores), there should be no extreme outliers in any cell, and sphericity must hold for each within-subjects effect — more on that below, because SPSS tests it for you and tells you what to do when it fails.

Setting Up Your Data in SPSS

Repeated-measures ANOVA in SPSS uses wide format: one row per participant, and one column for every combination of factor levels. With caffeine (none, low, high) crossed with time of day (morning, evening), you need six columns — for example none_morn, none_eve, low_morn, low_eve, high_morn and high_eve — plus an ID column. Each row is one participant, and each cell holds that participant’s reaction time in that condition.

Give every variable a clear label in Variable View (for example, “Reaction time, no caffeine, morning”) so the output is readable later. Missing data is a problem here: SPSS uses listwise deletion for repeated-measures ANOVA, so a participant missing even one of the six scores is dropped from the whole analysis. If you have substantial missing data, deal with it before you run the test — see our guide on handling missing data in SPSS.

How to Run a Two-Way Repeated-Measures ANOVA in SPSS

Step 1: Open the Repeated Measures dialog

Go to Analyze > General Linear Model > Repeated Measures. This is the same starting point as the one-way version — the difference is that you will define two within-subjects factors instead of one.

Step 2: Define the within-subjects factors

In the “Repeated Measures Define Factor(s)” dialog, type the name of your first factor (for example, caffeine), set the number of levels to 3, and click Add. Then type the second factor (for example, timeofday), set its levels to 2, and click Add. In the “Measure Name” box, type a name for your dependent variable (for example, reactiontime) and click Add. Then click Define.

Step 3: Assign the variables to the cells

SPSS now shows six within-subjects variables, labelled like caffeine(1), timeofday(1) through caffeine(3), timeofday(2). Move the matching data column into each slot: the first slot is caffeine level 1 at time level 1, the second is caffeine level 1 at time level 2, and so on. Take your time here — assigning a column to the wrong cell is the most common mistake in this analysis, and SPSS will not warn you. Double-check the order against your Variable View before continuing.

Step 4: Ask for plots

Click Plots. Move caffeine to the horizontal axis and timeofday to the “Separate Lines” box, click Add, then Continue. The profile plot is the fastest way to see an interaction: if the lines are roughly parallel, there is probably no interaction; if they cross or fan apart, there probably is. Our separate guide on creating an interaction plot in SPSS explains how to read these plots in detail.

Step 5: Ask for pairwise comparisons

Click EM Means. Move caffeine, timeofday and the caffeine*timeofday interaction into the “Display Means for” box. Tick Compare main effects and choose Bonferroni from the confidence-interval adjustment dropdown. Then click Continue. This gives you adjusted pairwise comparisons for each factor and for the interaction, so you can say exactly which conditions differ.

Step 6: Ask for descriptives and effect sizes

Click Options. Tick Descriptive statistics, Estimates of effect size and Homogeneity tests. Click Continue, then OK to run the analysis.

SPSS Syntax for a Two-Way Repeated-Measures ANOVA

The menu clicks above generate syntax you can save and re-run. The syntax below is for the caffeine and time-of-day example — replace the variable names with your own:

GLM none_morn none_eve low_morn low_eve high_morn high_eve
  /WSFACTOR=caffeine 3 Polynomial timeofday 2 Polynomial
  /MEASURE=reactiontime
  /METHOD=SSTYPE(3)
  /PLOT=PROFILE(caffeine*timeofday)
  /EMMEANS=TABLES(caffeine) COMPARE ADJ(BONFERRONI)
  /EMMEANS=TABLES(timeofday) COMPARE ADJ(BONFERRONI)
  /EMMEANS=TABLES(caffeine*timeofday) COMPARE(timeofday) ADJ(BONFERRONI)
  /PRINT=DESCRIPTIVE ETASQ HOMOGENEITY
  /CRITERIA=ALPHA(.05)
  /WSDESIGN=caffeine timeofday caffeine*timeofday.

The /WSFACTOR subcommand defines the two within-subjects factors and their levels. /PLOT=PROFILE draws the interaction plot. The three /EMMEANS lines request Bonferroni-adjusted pairwise comparisons for each factor and for the interaction (the last line compares time of day separately at each caffeine level, which is how you follow up an interaction). /PRINT=ETASQ adds partial eta squared as the effect size, and /WSDESIGN specifies the model: both main effects plus the interaction.

How to Interpret the SPSS Output

Descriptive statistics

Start here. Check the cell means and standard deviations — do they look plausible, and is any cell mean wildly different from the rest? This table is also where you take the means and standard deviations you will report.

Mauchly’s test of sphericity

SPSS tests sphericity separately for each within-subjects effect. Look at the p-value for each effect: if p > .05, sphericity is assumed and you read the “Sphericity Assumed” row of the next table. If p < .05, sphericity is violated and you should read the Greenhouse–Geisser corrected row instead — SPSS prints both, so you only need to pick the right one. Note that a factor with only two levels (like our time-of-day factor) always has a single degree of freedom for its effect, so sphericity cannot be violated for it and Mauchly’s test is not printed for that effect.

Tests of within-subjects effects

This is the main results table. It has three rows that matter: the main effect of caffeine, the main effect of time of day, and the caffeine*timeofday interaction. For each, read the F value, the degrees of freedom, the p-value (labelled “Sig.”) and the partial eta squared.

Always interpret the interaction first. If the interaction is significant, the main effects are misleading on their own — the effect of caffeine depends on the time of day, so reporting a single “caffeine effect” hides the real story. In that case, follow up with the pairwise comparisons for the interaction (comparing time of day at each caffeine level, or caffeine levels within each time of day) and describe the pattern using the profile plot. If the interaction is not significant, you can interpret the two main effects directly.

Multivariate tests

SPSS also prints a multivariate tests table (Pillai’s trace, Wilks’ lambda, and others). These tests do not assume sphericity, so they are a useful cross-check: if the multivariate result and the corrected univariate result agree, you can report the findings with confidence. If they disagree, the Greenhouse–Geisser corrected univariate result is the one most researchers report.

Pairwise comparisons

The “Pairwise Comparisons” tables show the mean difference between each pair of conditions, with a Bonferroni-adjusted p-value. A significant comparison means those two conditions genuinely differ. Report only the comparisons that answer your research question — with three caffeine levels there are three pairwise comparisons, and with a significant interaction there are further comparisons within each time of day. Do not list every number in your write-up; pick the ones that tell the story.

Effect sizes

Partial eta squared (ηp²) is printed for every effect. It tells you what proportion of the variance in the outcome is accounted for by that effect, after removing the variance due to other effects. Report it alongside every F test. As a rough guide, values around .01 are small, around .06 are medium, and around .14 or above are large — but treat these as a rough guide, not a verdict, and always interpret the size in the context of your field.

What to Do When Sphericity Is Violated

A significant Mauchly’s test is common with three or more levels, and it is not a reason to abandon the analysis. Read the Greenhouse–Geisser row of the “Tests of Within-Subjects Effects” table — the correction lowers the degrees of freedom, which makes the test more conservative. If the effect stays significant after the correction, report the Greenhouse–Geisser result and say so. The multivariate tests are an alternative that avoids the sphericity assumption entirely. What you should not do is ignore the violation and report the “Sphericity Assumed” row anyway, because that inflates the chance of a false positive. For a fuller discussion of assumption checks and the alternatives available when your data are not normal, see our guide on what to do when your data is not normal in SPSS.

Reporting in APA Style (7th ed.)

Report the interaction first, then the main effects, then the follow-up comparisons. Always give the F statistic with both degrees of freedom, the p-value, the effect size, and the cell means with standard deviations. Here is a template you can adapt:

A 3 (caffeine: none, low dose, high dose) × 2 (time of day: morning, evening) repeated-measures ANOVA was conducted on reaction time. The caffeine × time of day interaction was significant, F(2, 46) = 6.84, p = .002, ηp² = .23. Follow-up pairwise comparisons with a Bonferroni correction showed that the high dose improved reaction time relative to no caffeine in the morning (mean difference = −38 ms, p = .004) but not in the evening (mean difference = −6 ms, p = .71). The main effect of caffeine was significant, F(2, 46) = 9.12, p < .001, ηp² = .28, and the main effect of time of day was significant, F(1, 23) = 5.47, p = .028, ηp² = .19. Reaction times were faster in the morning (M = 412 ms, SD = 48) than in the evening (M = 438 ms, SD = 51).

A few APA details to get right: italicise F, p, M, SD and ηp²; report exact p-values to two or three decimal places (use p < .001 when SPSS prints .000); put a space on either side of the equals sign; and never write p = .000. If sphericity was violated, add a sentence such as “Mauchly’s test indicated that the assumption of sphericity had been violated for caffeine, χ²(2) = 8.41, p = .015, so Greenhouse–Geisser corrected values are reported.” Note that the numbers in the example above are illustrative — always report the values from your own output.

Key Takeaways

  • A two-way repeated-measures ANOVA tests two within-subjects factors and their interaction in a single analysis — the same participants are measured in every condition.
  • Set up the data in wide format, one row per participant and one column per combination of factor levels, and double-check the cell assignment in the Define dialog.
  • Interpret the interaction before the main effects: a significant interaction means each factor’s effect depends on the other factor’s level.
  • Check Mauchly’s test of sphericity for each effect; when it is significant, report the Greenhouse–Geisser corrected row.
  • Follow up significant effects with Bonferroni-adjusted pairwise comparisons and report partial eta squared alongside every F test.
  • Report in APA style with F, degrees of freedom, exact p-values, effect sizes, and cell means with standard deviations.

Frequently Asked Questions

What is the difference between a two-way repeated-measures ANOVA and a mixed ANOVA?

In a two-way repeated-measures ANOVA, both factors are within-subjects — every participant experiences every combination of conditions. In a mixed ANOVA, one factor is between-subjects (different participants in each group) and one is within-subjects. The two designs answer different questions and are run through different SPSS dialogs, so pick the design that matches how your data were collected.

Can I run a two-way repeated-measures ANOVA with unequal numbers of participants in each condition?

There are no separate groups in this design — every participant contributes one score to every cell. If a participant is missing a score in one cell, SPSS drops that participant from the whole analysis by listwise deletion. If that loses too much data, handle the missing values before running the test.

What should I do if the interaction is significant?

Do not interpret the main effects on their own. Instead, follow up the interaction with pairwise comparisons at each level of one factor — for example, compare the caffeine conditions separately in the morning and in the evening. The profile plot shows the pattern visually, and the /EMMEANS comparisons in the syntax above give you the adjusted p-values.

Why does SPSS not print Mauchly’s test for my two-level factor?

Sphericity only becomes an issue when a factor has three or more levels. With two levels there is only one difference score, so sphericity is automatically satisfied and no test is needed. Mauchly’s test appears only for factors (and interactions) with more than two levels.

How is a two-way repeated-measures ANOVA different from running two one-way ANOVAs?

Two one-way ANOVAs would test each factor separately but could never test the interaction — the question of whether one factor’s effect depends on the other. They would also ignore the correlation between the two sets of measurements. The two-way analysis tests both main effects and the interaction in one model, which is both more powerful and the only way to answer the interaction question.

Related Guides

Need professional guidance with your SPSS analysis? Contact us → /services/