# Replicating results from Levine's Guide to SPSS for Analysis of Variance, repeated measures with varying covariate example

## Technote (troubleshooting)

## Problem(Abstract)

In the Second Edition of Levine's Guide to SPSS for Analysis of Variance, a data set is shown with three levels of a repeated measures variable and a covariate that varies over this within subjects factor. SPSS MANOVA results are shown to produce regression coefficients for between and within subjects regressions, and the two regression coefficients are used to hand compute adjusted means, which are shown in Table 11.2. Is there any way to produce these results in SPSS without doing hand computations?

## Resolving the problem

The following set of SPSS commands will produce the desired results. The AGGREGATE command is used to add to the current file a copy of the mean value of the covariate over the three levels of factb for each subject. The first run of the MIXED procedure produces the between subjects regression coefficient and its significance test (as well as a confidence interval). Although the between subjects facta results are also the correct ones, these are also available in the second run, so gathering simply the between subjects regression results from this first run can be recommended. The second MIXED run produces the within subjects regression coefficient and tests for all effects in the model except the between subjects regression, and also produces the adjusted means that match those in the book (to within rounding; the values in the book were produced using less precision). Ignore the cv_mean (between subjects regression) results, as they are not the desired ones.

AGGREGATE

/OUTFILE=* MODE=ADDVARIABLES

/BREAK=subj

/cv_mean=MEAN(cv).

MIXED dv BY facta factb WITH cv_mean

/FIXED = facta factb facta*factb cv_mean

/PRINT = SOLUTION

/REPEATED = factb | SUBJECT(subject) COVTYPE(CS).

MIXED dv BY facta factb WITH cv cv_mean

/FIXED = facta factb facta*factb cv cv_mean

/PRINT = SOLUTION

/REPEATED = factb | SUBJECT(subject) COVTYPE(CS)

/EMMEANS = TABLES(OVERALL)

/EMMEANS = TABLES(facta)

/EMMEANS = TABLES(factb)

/EMMEANS = TABLES(facta*factb).

Note that if there are no missing values for any of the variables specified in the second command, and all subjects have complete data on all time points (all levels of factb), the first command may be simplified to:

MIXED dv BY facta WITH cv_mean

/FIXED = facta cv_mean

/PRINT = SOLUTION

/REPEATED = factb | SUBJECT(subject) COVTYPE(CS).

## Historical Number

45170

### Document information

**More support for:**
SPSS Statistics

**Software version:**
Not Applicable

**Operating system(s):**
Platform Independent

**Reference #:**
1479593

**Modified date:**
2014-03-11