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.
Quick answer: How do you run an ANCOVA in SPSS?
- Click Analyze › General Linear Model › Univariate.
- Move the outcome into Dependent Variable, the groups into Fixed Factor(s) and the covariate into Covariate(s).
- Under EM Means… move the factor across and tick Compare main effects.
- 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.
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
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.