Lesson 14: Analysis of Covariance


  1. Perform and interpret an analysis of covariance using the General Linear Model.
  2. Perform and interpret an analysis of covariance using hierarchical regression.

Analysis of covariance (ANCOVA) is a blending of regression and analysis of variance (Roscoe, 1975). It is possible to perform ANCOVA using the General Linear Model procedure in SPSS. An entirely equivalent analysis is also possible using hierarchical regression, so the choice is left to the user and his or her preferences. We will illustrate both procedures in this tutorial. We will use the simplest of cases, a single covariate, two treatments, and a single variate (dependent variable).

ANCOVA is statistically equivalent to matching experimental groups with respect to the variable or variables being controlled (or covaried). As you recall from correlation and regression, if two variables are correlated, one can be used to predict the other. If there is a covariate(X) that correlates with the dependent variable (Y), then dependent variable scores can be predicted by the covariate. If this is the case, the differences observed between the groups cannot then be attributed to the experimental treatment(s). ANCOVA provides a mechanism for assessing the differences in dependent variable scores after statistically controlling for the covariate. There are two obvious advantages to this approach: (1) any variable that influences the variation in the dependent variable can be statistically controlled, and (2) this control can reduce the amount of error variance in the analysis.

Example Data

Assume that you are comparing performance in a statistics class taught by two different methods. Students in one class are instructed in the classroom, while students in the second class take their class online. Both classes are taught by the same instructor, and use the same textbook, exams, and assignments. At the beginning of the term all students take a test of quantitative ability (pretest), and at the end, their score on the final exam is recorded (posttest). Because the two classes are intact, it is not possible to achieve experimental control, so this is a quasi-experimental design. Assume that you would like to compare the scores for the two groups on the final score while controlling for initial quantitative ability. The hypothetical data are as follows:

Lesson 14 Example Data

Before the ANCOVA

You may retrieve the SPSS dataset if you like. As a precursor to the ANCOVA, let us perform a between-groups t test to examine overall differences between the two groups on the final exam. You will find or recall this test as the subject of Lesson 4, and details will not be repeated here. The result of the t test is shown below. See Figure 14-1. Of course, as you know, if there were multiple groups you would perform an ANOVA rather than a t test. In this case, we conclude that the second method led to improved test scores, but must rule out the possibility that this difference is attributable to differences in quantitative ability of the two groups. As you know by now, you could just as easily have compared the means using the Compare Means or One-way ANOVA procedures, and the square root of the F-ratio obtained would be the value of t.

t Test Results
Figure 14-1 t Test Results

As a second precursor to the ANCOVA, let us determine the degree of correlation between quantitative ability and exam scores. As correlation is the subject of Lesson 10, the details are omitted here, and only the results are shown in Figure 14-2.

Figure 14-2 Correlation between pretest and posttest scores

Knowing that there is a statistically significant correlation between pretest and posttest scores, we would like to exercise statistical control by holding the effects of the pretest scores constant. The resulting ANCOVA will verify whether there are any differences in the posttest scores of the two groups after controlling for differences in ability.

Performing the ANCOVA in GLM

To perform the ANCOVA via the General Linear Model menu, select Analyze, General Linear Model, Univariate (see Figure 14-3).

ancova via glm
Figure 14-3 ANCOVA via the GLM procedure

In the resulting dialog box, move Posttest to the Dependent Variable field, Method to the Fixed Factor(s) field, and Pretest to the Covariate(s) field. See Figure 14-4.

ancova dialog box
Figure 14-4 Univariate dialog box

Under Options you may want to choose descriptive statistics and effect size indexes, as well as plots of estimated marginal means for Method. As there are just two groups, main effect comparisons are not appropriate. Examine Figure 14-5.

specifying ancova options
Figure 14-5 Univariate options for ANCOVA

Click Continue. If you like, you can click on Plots to add profile plots for the estimated marginal means of the posttest scores of the two groups after adjusting for pretest scores. Click on OK to run the analysis. The results are shown in Figure 14-6. The results indicate that after controlling for initial quantitative ability, the differences in posttest scores are statistically significantly different between the two groups, F(1,27)=16.64, p < .001, partial eta-squared = .381.

ancova results
Figure 14-6 ANCOVA results

The profile plot makes it clear that the online class had higher exam scores after controlling for initial quantitative ability (see Figure 14-7).

profile plot
Figure 14-7 Profile plot

Performing an ANCOVA Using Hierarchical Regression

To perform the same ANCOVA using hierarchical regression, enter the posttest as the criterion. Then enter the covariate (pretest) as one independent variable block and group membership (method) as a second block. Examine the change in R-Square as the two models are compared, and the significance of the change. The F value produced by this analysis is identical to that produced via the GLM approach.

Select Analyze, Regression, Linear (see Figure 14-8).

ancova via hierarchical regression
Figure 14-8 ANCOVA via hierarchical regression

Now enter Posttest as the Dependent Variable and Pretest as an Independent variable (see Figure 14-9).

ancova in regression
Figure 14-9 Linear regression dialog box

Click on the Next button and enter Method as an Independent variable, as shown in Figure 14-10.

entering second block
Figure 14-10 Entering second block

Click on Statistics, and check the box in front of R squared change (see Figure 14-11).

specify r-square change
Figure 14-11 Specify R squared change

Click Continue then OK to run the hierarchical regression. Note in the partial output shown in Figure 14-12 that the value of F for the R Square Change with pretest held constant is identical to that calculated earlier.

hierarchical regression output
Figure 14-2 Hierarchical regression yields results identical to GLM


Roscoe, J. T. (1975). Fundamental research statistics for the behavioral sciences (2nd ed.). New York: Hot, Rinehart and Winston, Inc.

Return to the Top of This Page

Return to Menu Page