Unit 10 · Factorial designs

How to run an ANCOVA in SPSS

Run an ANCOVA in SPSS, control for a covariate such as a pre-test, check homogeneity of regression slopes and report adjusted means.

Free tutorialPro practiceAbout 5 minutes6 practice questions

Quick answer: How do you run an ANCOVA in SPSS?

  1. Click Analyze › General Linear Model › Univariate.
  2. Move the outcome into Dependent Variable, the groups into Fixed Factor(s) and the covariate into Covariate(s).
  3. Under EM Means… move the factor across and tick Compare main effects.
  4. Click OK and read the factor’s row and the adjusted means.

Report it in APA style: Controlling for pre-test scores, teaching method affected post-test scores, F(2, 56) = 5.86, p = .005, ηp² = .17.

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

What is ANCOVA?

Analysis of covariance (ANCOVA) compares group means on an outcome while statistically controlling for a covariate, a Scale variable related to the outcome, such as a pre-test score. It reduces error and adjusts for differences between groups on the covariate.

When to use it

  • Comparing groups on a post-test while adjusting for the pre-test.
  • Reducing noise from a known nuisance variable.
  • The covariate should be measured before the groups were treated differently.

How it works

ANCOVA removes the variance in the outcome that the covariate explains, then compares groups on what’s left. The results are reported with adjusted means: what each group’s mean would be if all groups had the same covariate score. Post hoc tests are replaced by comparisons of estimated marginal means (with a Bonferroni correction).

Assumptions

  • All ANOVA assumptions.
  • A linear relationship between covariate and outcome.
  • Homogeneity of regression slopes: the covariate relates to the outcome in the same way in every group (test the group × covariate interaction; it should be non-significant).
  • The covariate is measured reliably and isn’t affected by the treatment.

Worked example

Controlling for pre-test scores, teaching method affected post-test scores, F(2, 56) = 5.86, p = .005, ηp² = .17. Adjusted means: Seminar 68.9, Online 65.4, Lecture 61.2.

Key terms

Covariate
A Scale variable you control for.
Adjusted means
Group means after accounting for the covariate.
Homogeneity of regression slopes
Equal covariate–outcome slopes across groups.

Common mistakes

  • Using a covariate measured after the treatment.
  • Reporting unadjusted means.
  • Skipping the homogeneity of slopes check.

How to do it in SPSS

ANCOVA in the Univariate dialog

ANCOVA compares groups while controlling for a covariate, such as comparing teaching methods on a post-test after adjusting for the pre-test.

Univariate
Variables
Participant ID [id]
Age in years [age]
▶
Dependent Variable:1
Post-test score [posttest]
▶
Fixed Factor(s):2
Teaching method [method]
▶
Covariate(s):3
Pre-test score [pretest]
Model…4Contrasts…Plots…Post Hoc…EM Means…5Save…Options…
OKPasteResetCancelHelp
  1. 1
    Dependent VariableThe outcome you’re comparing.
  2. 2
    Fixed Factor(s)The groups.
  3. 3
    Covariate(s)The Scale variable you want to control for. It should be measured before the groups were treated differently.
  4. 4
    Model…To test homogeneity of regression slopes, run once with a Custom model including method * pretest. It should be non-significant.
  5. 5
    EM Means…Move method across and tick Compare main effects (Bonferroni) to get adjusted means and comparisons. Post Hoc… is greyed out once there’s a covariate.

Reading ANCOVA output

Read the method row for your main result, then report the adjusted means.

Output1 [Document1] – SPSS Statistics Viewer
FileEditViewDataTransformAnalyzeGraphsUtilitiesExtensionsWindowHelp
Output
Log
Univariate Analysis of Variance
Tests of Between-Subjects Effects
Estimated Marginal Means
Tests of Between-Subjects Effects · Dependent Variable: posttest
SourceType III Sum
of Squares
dfMean
Square
FSig.Partial Eta
Squared
pretest12020.8012020.8042.10.000.429
method2562.562281.285.86.005.173
Error2688.005648.00
Corrected Total6200.0059
Estimated Marginal Means · method
methodMean3Std. Error
Lecture61.20a1.56
Seminar68.90a1.57
Online65.40a1.55

a. Covariates evaluated at: pretest = 52.30. Unadjusted means: Lecture 60.10, Seminar 70.20, Online 65.20

  1. 1
    CovariateThe pre-test strongly predicts the post-test. That’s expected and isn’t usually the focus.
  2. 2
    FactorAfter controlling for the pre-test, teaching method still mattered: F(2, 56) = 5.86, p = .005, ηp² = .17.
  3. 3
    Adjusted meansMeans as if every group had the same pre-test score (52.30). Report these, not the raw means.

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.

* Check homogeneity of regression slopes first: the pretest*method row should be non-significant.
UNIANOVA posttest BY method WITH pretest
  /METHOD=SSTYPE(3)
  /DESIGN=pretest method pretest*method.

* The ANCOVA itself, with adjusted means and Bonferroni comparisons.
UNIANOVA posttest BY method WITH pretest
  /METHOD=SSTYPE(3)
  /EMMEANS=TABLES(method) WITH(pretest=MEAN) COMPARE ADJ(BONFERRONI)
  /PRINT=ETASQ DESCRIPTIVE HOMOGENEITY
  /DESIGN=pretest method.

Practice data

Download the file used in this lesson and run it yourself in SPSS. Your results will closely match the screens above, though a few numbers may differ slightly.

  • ancova.savPre-test and post-test scores by teaching method (N = 60)

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