### SPSS Textbook Examples Design & Analysis by Keppel Chapter 14

Chapter 14

#### Chapter 14: The Analysis of Covariance

14.1 Analysis of Covariance and Adjusted Means, Pages 312-314 of Keppel
Example 14.1a..SPSS MANOVA
Example 14.1b. SPSS GLM
Example 14.1c. SAS PROC GLM
14.2 Comparisons of Adjusted Means, Page 316 of Keppel
Example 14.2a..SPSS MANOVA
Example 14.2b. SPSS GLM
Example 14.2c. SAS PROC GLM
14.3 Test of Homogeneity of Regression, Page 320 of Keppel
Example 14.3a..SPSS MANOVA
Example 14.3b. SPSS GLM
Example 14.3c. SAS PROC GLM

14.1 Analysis of Covariance and Adjusted Means, Pages 312-314 of Keppel

Pages 312-314 illustrate how to perform a one way Analysis of Covariance (ANCOVA) and how to compute adjusted means.  This example compares three treatments (a1, a2, a3).   Associated with each treatment we have a score on the dependent variable (indicated by y) and a covariate that is correlated with the dependent variable (indicated by x). The data for this experiment is shown below.

 subject a=1 a=2 a=3 1 2 3 4 5 6 7 8 X 10 6 5 8 9 4 9 12 Y 15 1 4 6 10 0 7 13 X 4 8 8 8 6 11 10 9 Y 6 13 5 18 9 7 15 15 X 7 8 7 3 6 8 6 8 Y 14 9 16 7 13 18 13 6

This can be analyzed using SPSS manova, SPSS glm, or SAS proc glm. All of these examples use the CHAP14 (SPSS, SAS) data file. The following examples illustrate how to perform a one way Analysis of Covariance using this data.

Example 14.1a. SPSS MANOVA

MANOVA y BY a(1,3) WITH x
/PMEANS TABLES(a). 

The manova command above requests an ANCOVA on the dependent variable y and a covariate x.  Supplying variables after with indicates the variable should be included as a covariate.  The /pmeans subcommand is used to request adjusted means for each level of factor a.

Example 14.1b. SPSS GLM

GLM y BY a WITH x
/EMMEANS TABLES(a). 

Example 14.1c. SAS PROC GLM

PROC GLM DATA=CHAP14;
CLASS a;
MODEL y = a x ;
LSMEANS a ;
RUN; 

14.2 Comparisons of Adjusted Means, Page 316 of Keppel

Page 316 illustrates how to perform comparisons among adjusted means in a one way Analysis of Covariance (ANCOVA).  This can be analyzed using SPSS manova, SPSS glm or SAS proc glm.  The data used is the same as that shown in section 14.1 above, and these examples use the CHAP14 (SPSS, SAS) data file. As you will see, the SPSS/SAS commands for performing comparisons in ANCOVA is really identical to those commands that were used to perform comparisons in a one way ANOVA (see Chapter 6).

Example 14.2a. SPSS MANOVA

MANOVA y BY a(1,3) WITH x
/CONTRAST(a) = SPECIAL( 1    1    1
1 -0.5 -0.5
0    1   -1)
/DESIGN = a(1) a(2). 

As was illustrated in Chapter 6, the /contrast subcommand is used for requesting comparisons among the means.  The first comparison compares a1 to (a2 and a3) and the second compares a2 to a3. The /design subcommand is used to request the contrasts to be performed.

Example 14.2b. SPSS GLM

GLM y BY a WITH x
/LMATRIX a 1 -1/2 -1/2
/LMATRIX a 0  1   -1 . 

Example 14.2c. SAS PROC GLM

PROC GLM DATA=CHAP14;
CLASS a;
MODEL y = a x ;
LSMEANS a ;
CONTRAST "a1 vs (a2 a3)" a 1 -.5 -.5 ;
CONTRAST "    a2 vs  a3" a 0   1  -1 ;
RUN; 

14.3 Test of Homogeneity of Regression, Page 320 of Keppel

An important assumption of ANCOVA is called the homogeneity of regression assumption.  It is assumed that the regression coefficients between  the covariate and the dependent variable is constant across treatments.  Keppel illustrates how to test this assumption on page 320.  This test can be performed using SPSS manova, SPSS glm, or SAS proc glm.  The data used is the same as that shown in section 14.1 above, and these examples use the CHAP14 (SPSS, SAS) data file.

Example 14.3a. SPSS MANOVA

MANOVA y BY a(1,3) WITH x
/ANALYSIS y
/DESIGN = a, x, a BY x. 

The homogeneity of regression assumption can be tested by including an interaction term between the covariate and the grouping variable (i.e., a by x).  If the regression coefficients do differ across groups, then this interaction will be significant.  Since this interaction is not provided by default by SPSS, we request it manually via the /design = a, x, a by x subcommand.   In addition to the a and x effect (which would have been provided by default), we request the a by x interaction.   (In order to specify this term, we first need to use the /analysis y subcommand to affirm to SPSS that the dependent variable is indeed y which then allows us to use the variable x in the /design subcommand. SPSS does not permit you to include the covariate on the /design subcommand and will give you an error unless you first include the /analysis y subcommand.)

Example 14.3b. SPSS GLM

GLM y  BY a  WITH x
/DESIGN = a x a*x . 

Example 14.3c. SAS PROC GLM

PROC GLM DATA=CHAP14;
CLASS a;
MODEL y = a x a*x ;
RUN; 

Summary

 Under Construction

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.