IBM Support

Computing and testing mean differences in Statistics MIXED

Troubleshooting


Problem

Using IBM SPSS Statistics MIXED, how can I determine the magnitudes of mean differences and compute the p-values associated with these differences?

Resolving The Problem

For many mean comparisons, including pairwise comparisons among the levels of a factor averaging over other factors or within the levels of other factors (simple effects comparisons), the EMMEANS COMPARE options are available. For comparisons that cannot be made using EMMEANS with COMPARE, as well as other arbitrary estimable functions of the model parameters, you can use the TEST subcommand.

Knowing how to estimate the means is a prerequisite for understanding how mean differences may be computed and tested. Here we show how to use the TEST subcommand to estimate the means from a repeated measures ANCOVA example given in Winer (1971, p.806). To create the data, copy and paste the following into a syntax window and select Run>All.

DATA LIST FREE
/ person group time x y .
BEGIN DATA
1 1 1 3 8
1 1 2 4 14
2 1 1 5 11
2 1 2 9 18
3 1 1 11 16
3 1 2 14 22
4 2 1 2 6
4 2 2 1 8
5 2 1 8 12
5 2 2 9 14
6 2 1 10 9
6 2 2 9 10
7 3 1 7 10
7 3 2 4 10
8 3 1 8 14
8 3 2 10 18
9 3 1 9 15
9 3 2 12 22
END DATA .
FORMATS person x y (F1.0) .

The basic SPSS Command Syntax for estimating the mixed linear model in the cited example is as follows.

MIXED Y BY group time WITH x
/FIXED = x group time group*time
/REPEATED = time | SUBJECT(person) COVTYPE(CS).

In this example, Group has three levels, Time has two levels, and X is a nonconstant covariate. The commands below show how to obtain estimated marginal means (EMMEANS) for group, time and group*time with x set to the grand mean of 7.5 using TEST rather than EMMEANS.

MIXED Y BY group time WITH x
/FIXED = x group time group*time
/REPEATED = time | SUBJECT(person) COVTYPE(CS)
/TEST 'Mean of Time = 1' INTERCEPT 1
group 1/3 1/3 1/3
time 1 0
group*time 1/3 0 1/3 0 1/3 0
x 7.5
/TEST 'Mean of Time = 2' INTERCEPT 1
group 1/3 1/3 1/3
time 0 1
group*time 0 1/3 0 1/3 0 1/3
x 7.5
/TEST 'Mean of Group = 1' INTERCEPT 1
group 1 0 0
time 1/2 1/2
group*time 1/2 1/2 0 0 0 0
x 7.5
/TEST 'Mean of Group = 2' INTERCEPT 1
group 0 1 0
time 1/2 1/2
group*time 0 0 1/2 1/2 0 0
x 7.5
/TEST 'Mean of Group = 3' INTERCEPT 1
group 0 0 1
time 1/2 1/2
group*time 0 0 0 0 1/2 1/2
x 7.5
/TEST 'Mean of Group = 1, Time = 1' INTERCEPT 1
group 1 0 0
time 1 0
group*time 1 0 0 0 0 0
x 7.5
/TEST 'Mean of Group = 1, Time = 2' INTERCEPT 1
group 1 0 0
time 0 1
group*time 0 1 0 0 0 0
x 7.5
/TEST 'Mean of Group = 2, Time = 1' INTERCEPT 1
group 0 1 0
time 1 0
group*time 0 0 1 0 0 0
x 7.5
/TEST 'Mean of Group = 2, Time = 2' INTERCEPT 1
group 0 1 0
time 0 1
group*time 0 0 0 1 0 0
x 7.5
/TEST 'Mean of Group = 3, Time = 1' INTERCEPT 1
group 0 0 1
time 1 0
group*time 0 0 0 0 1 0
x 7.5
/TEST 'Mean of Group = 3, Time = 2' INTERCEPT 1
group 0 0 1
time 0 1
group*time 0 0 0 0 0 1
x 7.5 .


Now let's suppose you wanted to compute the difference between Group 1 scores at Time 1 and Group 1 scores at Time 2. To begin with we need to review how the means themselves are estimated using the TEST subcommand. The following two Test subcommands estimate each mean in turn.

/TEST 'Mean of Group = 1, Time = 1' INTERCEPT 1
group 1 0 0
time 1 0
group*time 1 0 0 0 0 0
x 7.5

/TEST 'Mean of Group = 1, Time = 2' INTERCEPT 1
group 1 0 0
time 0 1
group*time 0 1 0 0 0 0
x 7.5


The test of the difference between these two means involves nothing more than inputting a TEST subcommand in which the numerical entries are the arithmetic differences between the values given in the two subcommands that estimate the means.

For example, the INTERCEPT value for the Group 1 Time 1 is 1 and the INTERCEPT value for Group 1 Time 2 is 1. The difference between these two values is zero. Hence, the value we need for the INTERCEPT is zero. If you continue in this vein, you should be able to arrive at a TEST subcommand like the following.

/TEST 'Group[1]Time[1] v. Group[1]Time[2]'
INTERCEPT 0
group 0 0 0
time 1 -1
group*time 1 -1 0 0 0 0
x 0

Because effects that are missing from the TEST command are assumed to be zero, this subcommand may be simplified as follows.

/TEST 'Group[1]Time[1] v. Group[1]Time[2]'
time 1 -1
group*time 1 -1 0 0 0 0

If you run the MIXED commands with this TEST subcommand embedded, you'll find that the mean difference is -4.077, which is significant at p < .001.
__________________________

References

Winer, B. J. (1971). Statistical principles in experimental design (2nd Ed.). New York: McGraw-Hill.

Winer, B. J., Brown, D. R. & Michels, K. M. (1991). Statistical principles in experimental design (3rd Ed.). New York: McGraw-Hill.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

23447

Document Information

Modified date:
16 April 2020

UID

swg21477179