Reading: SPSS Advanced Models 9.0:
Syntax for GLM: Univariate - /EMMEANS Subcommand, pp 337-338
-
/LMATRIX Subcommand, pp. 330-331
Homework:
Download: glm_2way.sav (Download Tips)
![]()
A significant interaction effect can be analyzed as the simple main effects of one variable within each level of the other variable. The means for interaction between reward and drive level are shown in Figure 1 (General Linear Model (GLM): Two-way, Between-Subjects Designs notes). Our earlier discussion of this interaction noted that it looked as though there was no effect of reward in the high drive (24-hour deprivation) condition and that the effect of reward looked significant in the low drive (1-hour deprivation) condition.
Figure 1. Profile Plot of the Reward by Drive Level Interaction
You can use a simple main effects analysis to directly test that interpretation. Lets do an analysis on the three reward means within the high drive condition and another analysis on the reward means within the low drive condition. That analysis is called a "simple main effects" analysis.
We can edit the syntax for the Estimated Marginal Means subcommand, /EMMEANS, to easily create simple main effect tests. We begin with the basic set of syntax commands used to run a 2-way ANOVA using the GLM procedure. An easy way to do this is to use the GLM:Univariate dialog boxes to create the basic syntax for the 2-way ANOVA and then to add the commands to run the simple main effects. Here is a summary of the steps to follow:
(a) Select the dependent and independent variables.
(b) Go to the Estimated Marginal Means section of the Options.. dialog box and move all the effects from the full factorial to the Display Means for... window.
(c) Check the Compare Main Effects box in the Estimated Marginal means Window.
By default the confidence intervals for the main effect tests and the simple main effect tests will not be adjusted, that is, the LSD (none) test will be used when creating the confidence intervals. You can choose to have the confidence intervals adjusted using either the Bonferonni procedure or the Sidak procedure. The Bonferonni procedure adjusts the alpha level as follows:
Bonferonni alpha = significance level/C
where C is the number of paired comparisons and significance level is the alpha level specified at the bottom of the Options... dialog box. The Sidak procedure adjusts the alpha level as follows:
Sidak alpha = significance level - (1 - significance level)1/C
where C is the number of paired comparisons and significance level is the alpha level specified at the bottom of the Options... dialog box.
Lets select the Sidak procedure.
(d) Go back to the GLM - General Factorial main dialog box and Paste the commands to the syntax window.
Table 1 shows the basic syntax as created by the GLM dialog boxes.
| Lets focus on the three /EMMEANS subcommands. The first one
will create a pairwise comparison for the reward main effect; the confidence interval will
be adjusted using the Sidak procedure. The second one will create a pairwise
comparison for the drive main effect; the confidence interval will be adjusted by the
Sidak procedure. It looks as though the third /EMMEANS subcommand will create a pairwise comparison for the drive*reward interaction. But it won't yet do that, it is a future feature of GLM. All it does is print the marginal means for the interaction. We are not interested in either of the main effects in this analysis so lets just delete them from the syntax commands. We can turn the drive*reward interaction into a subcommand to test the simple main effect reward within each of the two drive levels by adding the syntax COMPARE (reward) ADJ(SIDAK) /EMMEANS TABLES(drive*reward) COMPARE (reward) ADJ(SIDAK) The final syntax is shown in Table 2. Note: The following subcommands: /METHOD = SSTYPE(3) state the default values for GLM, they could be omitted from the syntax command set. |
|
|
|
To run the simple main effects analysis you simply Run the syntax commands from the Syntax dialog box.
The output from the /EMMEANS simple main effects subcommand includes three tables: Estimates, the estimated interaction means, See Table 3; Univariate Tests of the simple effects of reward within low drive and the simple effects of reward within high drive, see Table 4; and Pairwise Comparisons for reward within each level of drive, see Table 5.
Table 3. Estimates
Dependent Variable: Number correct on the 20 training trials
Mean |
Std. Error |
95% Confidence Interval |
|||
Drive level of animals (hours of deprivation) |
Magnitude of reward |
Lower Bound |
Upper Bound |
||
1 hour deprived |
1 grape |
3.000 |
2.141 |
-1.498 |
7.498 |
3 grapes |
10.000 |
2.141 |
5.502 |
14.498 |
|
5 grapes |
14.000 |
2.141 |
9.502 |
18.498 |
|
24 hours deprived |
1 grape |
11.000 |
2.141 |
6.502 |
15.498 |
3 grapes |
12.000 |
2.141 |
7.502 |
16.498 |
|
5 grapes |
10.000 |
2.141 |
5.502 |
14.498 |
Table 4. Univariate Tests
Dependent Variable: Number correct on the 20 training trials
Drive level of animals (hours of deprivation) |
Sum of Squares |
df |
Mean Square |
F |
Sig. |
|
1 hour deprived |
Contrast |
248.000 |
2 |
124.000 |
6.764 |
.006 |
Error |
330.000 |
18 |
18.333 |
|||
24 hours deprived |
Contrast |
8.000 |
2 |
4.000 |
.218 |
.806 |
Error |
330.000 |
18 |
18.333 |
|||
| Each F tests the simple effects of Magnitude of reward within each level combination of the other effects shown. These tests are based on the linearly independent pairwise comparisons among the estimated marginal means. | ||||||
To interpret these results you could begin by describing the two overall tests of the simple main effects. A parsimonious description might go like this:
|
The reward by drive interaction effect was analyzed using a simple main effects analysis. Reward levels influenced performance for animals in the low drive(1-hour deprived) condition, F(2, 18)= 6.76, p = .006, but reward levels did not influence performance for animals in the high drive (24-hours deprived) condition, F(2, 18) = 0.22, p = .806. |
Because there are three levels of reward we don't know which levels of reward within the low drive conditions are significantly different. We need one additional analysis, the pairwise comparison between the reward levels within low drive. That analysis is shown in Table 5.
Table 5. Pairwise Comparisons
Dependent Variable: Number correct on the 20 training trials
Mean Difference (I-J) |
Std. Error |
Sig.a |
95% Confidence Interval for Differencea |
||||
Drive level of animals (hours of deprivation) |
(I) Magnitude of reward |
(J) Magnitude of reward |
Lower Bound |
Upper Bound |
|||
1 hour deprived |
1 grape |
3 grapes |
-7.000 |
3.028 |
.095 |
-14.966 |
.966 |
5 grapes |
-11.000* |
3.028 |
.006 |
-18.966 |
-3.034 |
||
3 grapes |
1 grape |
7.000 |
3.028 |
.095 |
-.966 |
14.966 |
|
5 grapes |
-4.000 |
3.028 |
.494 |
-11.966 |
3.966 |
||
5 grapes |
1 grape |
11.000* |
3.028 |
.006 |
3.034 |
18.966 |
|
3 grapes |
4.000 |
3.028 |
.494 |
-3.966 |
11.966 |
||
24 hours deprived |
1 grape |
3 grapes |
-1.000 |
3.028 |
.983 |
-8.966 |
6.966 |
5 grapes |
1.000 |
3.028 |
.983 |
-6.966 |
8.966 |
||
3 grapes |
1 grape |
1.000 |
3.028 |
.983 |
-6.966 |
8.966 |
|
5 grapes |
2.000 |
3.028 |
.887 |
-5.966 |
9.966 |
||
5 grapes |
1 grape |
-1.000 |
3.028 |
.983 |
-8.966 |
6.966 |
|
3 grapes |
-2.000 |
3.028 |
.887 |
-9.966 |
5.966 |
||
| Based on estimated marginal
means * The mean difference is significant at the .05 level. a Adjustment for multiple comparisons: Sidak. |
|||||||
Based on the pairwise comparisons, the interpretation of the interaction could be stated as follows:
| The significant simple main effects of reward were further analyzed by pairwise comparisons using the Sidak adjustment for multiple comparisons. For animals in the low drive condition, performance was better at high reward (M = 14.0, SE = 2.14) than at low reward (M = 3.00, SE = 2.14, p = .006). Performance at the moderate reward (M = 10.0, SE = 2.14) fell between the low and high reward conditions, but was not significantly different from either of them. |
You could also examine the interaction by looking at the simple main effects of reward within each level of drive. The /EMMEANS subcommand would be
/EMMEANS=TABLES(drive*reward)COMPARE(drive)ADJ(SIDAK)
.
Try running it. Interpret the data based on those simple main effects and decide for yourself which interpretation seems better, the simple effects of reward within drive or the simple effects of drive within reward.
A simple main effects analysis of an interaction can be viewed from either of the perspectives described above, from the simple main effects of variable A within variable B or vice versa. Oftentimes, as in this example, one of the perspectives seems to capture the essence of the data better than the other perspective. Sometimes which perspective you choose will depend upon your theoretical basis for the study.
Simple main effects analyses of interaction effects are gaining in popularity. They are appearing in more and more statistics textbooks. However, there is a basic problem with this approach. An interaction occurs because the effects of one variable are not the same across the levels of the other variable( see Becker & Coolidge, 1991). Visually, an interaction is described as a set of nonparallel lines, such as shown in Figures 1 above. Computationally, a simple 2 x 2 interaction is computed as the difference of differences. For example, the following formula:
A x B interaction effect = (A1B1 - A2B1) - (A1B2 - A2B2),
describes the interaction as the difference of the differences between A1 and A2 within each level of B. In the example used in this set of notes the interaction was of the form shown in Figure 2, one of the simple main effects was significant while the other simple main effect was not.
| Figure 2. An Interaction Where one of the Simple Main Effects is Not Significant |
|---|
It is possible for the interaction to be significant but for neither of the simple main effects to be significant. This sometimes happens when the slopes for the simple main effects are of the opposite sign and interaction is marginally significant, see the example in Figure 3. This can occur because the interaction is not a test of individual simple effects but a comparison of simple effect differences. That is, the difference of the differences can be significant even though none of the simple main effects are significant. As the overall interaction effect becomes larger, then one or more of the simple main effects will also become significant.
| Figure 3. An interaction Where the Slopes of the Simple Effects are of Opposite Sign. | Figure 4. An Interaction Where the Slopes of Both Simple Effects are of the Same Sign (and Both are Significant). |
|---|---|
Another logical possibility is that the simple main effects have the same sign and both are significant. For example, in Figure 4 both simple main effects of A within B have positive slopes. The interpretation of this interaction is that the effects of A are stronger within B2 than within B1.
The /EMMEANS syntax for running simple main effects makes the simple main effects comparison and displays pairwise comparisons for each simple main effect. You may wish to make a specific contrast for the simple main effect rather than running all pairwise comparisons. You can use the /LMATRIX syntax to create your own contrasts. We begin with the basic set of syntax commands used to run a 2-way ANOVA using the GLM procedure. An easy way to do this is to use the GLM-General Factorial dialog boxes to create the basic syntax for the 2-way ANOVA and then to add the commands to run the simple main effects. Table 6 shows the basic syntax as created by the GLM dialog boxes.
| UNIANOVA score BY drive reward /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /CRITERIA = ALPHA(.05) /DESIGN = drive reward drive*reward . |
The /METHOD = SSTYPE(3), /INTERCEPT = INCLUDE, and /CRITERIA = ALPHA(.05) specify the default values, they will not be included in the syntax commands for this discussion..
Consider the following model
LB = l1µ +
l2drive1 + l3drive2
+
l3reward1 + l4reward2
+ l5reward3 +
l6drive1reward1
+ l7drive1reward2 + l8drive1reward3
+ l9drive2reward1 + l10drive2reward2
+ l11drive2reward3
The 11 ls in the model are coefficients. The first row in the model is the grand mean; the second row is the drive main effect; the third row is the reward main effect; and the last row is the drive by reward interaction. The order of the elements in equation LB is determined by the order of the independent variables in the GLM syntax. In Table 1 drive was specified prior to reward so the LB model specified the drive main effect prior to the reward main effect. The interaction was written as drive*reward, with drive coming prior to reward, for the same reason. We will make use of this model when we specify the contrasts for the simple main effects.
Lets begin by specifying the simple main effect of reward within low drive. The syntax for that simple main effect is shown in Table 7.
| UNIANOVA score BY drive reward /LMATRIX 'Reward differences at low drive level' REWARD -1 0 1 DRIVE*REWARD -1 0 1 0 0 0 ; REWARD -1 2 -1 DRIVE*REWARD -1 2 -1 0 0 0 /DESIGN = drive reward drive*reward . |
| Note: I have not been able to get these syntax commands to work by cutting the syntax commands from these notes and pasting them into the SPSS syntax editor. I have had to enter the syntax commands directly to get them to work. |
The syntax makes use of a set of coefficients called LMATRIX coefficients. The syntax has three rows. The first row
/LMATRIX 'Reward differences at low drive level'
tells SPSS that the coefficients that follow are LMATRIX coefficients. The text enclosed in quotes will be used to label the output.
The second and third row define the coefficients for the 2 degrees of freedom for the simple main effect. Each row includes the coefficients for the reward main effect (coefficients l3, l4, and l5) and for the corresponding elements in the drive* reward interaction (coefficients l6 trough l11). The semicolon at the end of line two is mandatory, it separates the two sets of coefficients.
REWARD -1 0 1 DRIVE*REWARD -1 0 1 0 0 0 ;
REWARD -1 2 -1 DRIVE*REWARD -1 2 -1 0 0 0
The main effect of reward has 2 df (df = #levels -1 = 3 -1 = 2). The simple main effect of reward within low drive has the same number of degrees of freedom, 2. We must specify a contrast for each degree of freedom.
First, lets define the two contrasts for reward. For example, we could use orthogonal polynomial contrasts. Orthogonal polynomial contrasts seem like a reasonable set of contrasts for this interaction because the reward means within the low drive condition look to be linear. The orthogonal polynomial coefficients for l3, l4 and l5 are
L1 for reward = (-1)reward1 + (0)reward2 + (1)reward3
for the linear orthogonal polynomial contrast, and
L2 for reward = (-1)reward1 + (2)reward2 + (-1)reward3 .
for the quadratic orthogonal polynomial contrast.
Next, recall that the coefficients for the drive*reward interaction are
l6drive1reward1 + l7drive1reward2 + l8drive1reward3 + l9drive2reward1 + l10drive2reward2 + l11drive2reward3 .
Coefficients l6, l7, and l8 are the effects of reward levels 1, 2 and 3 within low drive, drive1. Coefficients l9, l10 ,and l11are the effects of reward levels 1, 2, and 3 within high drive, drive2. The rule is that you apply the reward main effect coefficients to the corresponding reward coefficients in the drive*reward interaction. If you are testing the reward main effect within drive1then all the drive2 coefficients would be zero, and vice versa. So
REWARD -1 0 1 DRIVE*REWARD -1 0 1 0 0 0 ;
is the linear effect within the first level of drive and
REWARD -1 2 -1 DRIVE*REWARD -1 2 -1 0 0 0
is the quadratic effect within the first level of drive.
Finally, lets add the LMATRIX syntax for the simple main effect of reward within high drive (drive level 2), see Table 8.
| UNIANOVA score BY drive reward /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /CRITERIA = ALPHA(.05) /LMATRIX 'Reward differences at low drive level' REWARD -1 0 1 DRIVE*REWARD -1 0 1 0 0 0 ; REWARD -1 2 -1 DRIVE*REWARD -1 2 -1 0 0 0 /LMATRIX 'Reward differences at high drive level' REWARD -1 0 1 DRIVE*REWARD 0 0 0 -1 0 1; REWARD -1 2 -1 DRIVE*REWARD 0 0 0 -1 2 -1 /DESIGN = drive reward drive*reward . |
Look at the LMATRIX for the reward differences at high drive level. The drive* reward coefficients at drive level 1 are all set to zero while the drive*reward coefficients at drive level 2 are set to the corresponding coefficients for the reward main effect.
To run the simple main effects analysis you simply Run, All the syntax commands from the Syntax dialog box.
The output for the simple main effect reward within low drive are shown in Tables 9 and 10. Table 10 displays the results of for the two contrasts separately. L1 is the first contrast, the linear effect and L2 is the second contrast, the quadratic effect. The linear effect is significant because the confidence interval does not include zero. The quadratic effect is not significant, the confidence interval does include zero.
| Dependent Variable | |||
|---|---|---|---|
| Contrast | Number correct on the 20 training trials | ||
| L1 | Contrast Estimate | 11.000 | |
| Hypothesized Value | 0 | ||
| Difference (Estimate - Hypothesized) | 11.000 | ||
| Std. Error | 3.028 | ||
| 95% Confidence Interval for Difference | Lower Bound | 4.639 | |
| Upper Bound | 17.361 | ||
| L2 | Contrast Estimate | 3.000 | |
| Hypothesized Value | 0 | ||
| Difference (Estimate - Hypothesized) | 3.000 | ||
| Std. Error | 5.244 | ||
| 95% Confidence Interval for Difference | Lower Bound | -8.017 | |
| Upper Bound | 14.017 | ||
| a Based on the user-specified contrast coefficients (L') matrix: Reward differences at low drive level | |||
Table 5 shows the combined results for the 2 df test of the simple main effects of reward within the low drive condition. The effect was significant, F(2, 18) = 6.764, p = .006. The higher the reward the better the performance. The single degree of freedom tests indicated that the relationship between reward and performance was linear.
| Source | Sum of Squares | df | Mean Square | F | Sig. |
|---|---|---|---|---|---|
| Contrast | 248.000 | 2 | 124.000 | 6.764 | .006 |
| Error | 330.000 | 18 | 18.333 | ||
| a Computed using alpha = .05 | |||||
The output for the simple main effect reward within low drive are shown in Tables 11 and 12. Table 11 displays the results for the two contrasts separately. Neither contrast is significant, the confidence intervals for both contrasts include zero.
| Dependent Variable | |||
|---|---|---|---|
| Contrast | Number correct on the 20 training trials | ||
| L1 | Contrast Estimate | -1.000 | |
| Hypothesized Value | 0 | ||
| Difference (Estimate - Hypothesized) | -1.000 | ||
| Std. Error | 3.028 | ||
| 95% Confidence Interval for Difference | Lower Bound | -7.361 | |
| Upper Bound | 5.361 | ||
| L2 | Contrast Estimate | 3.000 | |
| Hypothesized Value | 0 | ||
| Difference (Estimate - Hypothesized) | 3.000 | ||
| Std. Error | 5.244 | ||
| 95% Confidence Interval for Difference | Lower Bound | -8.017 | |
| Upper Bound | 14.017 | ||
| a Based on the user-specified contrast coefficients (L') matrix: Reward differences at high drive level | |||
The 2 df test of the simple main effect of reward within the high drive condition is shown in Table 12. There was no effect of reward for animals in the high drive condition, F(2, 18) = 0.218, p = .806.
| Source | Sum of Squares | df | Mean Square | F | Sig. |
|---|---|---|---|---|---|
| Contrast | 8.000 | 2 | 4.000 | .218 | .806 |
| Error | 330.000 | 18 | 18.333 | ||
| a Computed using alpha = .05 | |||||
In the previous example we looked at the simple main effects of reward within each drive level. You could also look at the simple main effects of drive within each reward level. The plot that emphasizes the effects of drive within reward are shown in figure 5. It was created by selecting drive for the Horizontal Axis: and reward for the Separate Lines: option.
Figure 5. Profile Plot of the Reward by Drive Level Interaction
Emphasizing
the Effects of Drive Within Each Level of Reward
There is one degree of freedom for each of the drive within reward contrasts, so there is a single contrast for drive differences at each level. The contrast for drive is the difference between the two drive levels, so the drive coefficients are -1 and 1.
The syntax commands are shown in Table 13.
| UNIANOVA score BY drive reward /METHOD = SSTYPE(3) /INTERCEPT = INCLUDE /CRITERIA = ALPHA(.05) /LMATRIX 'Drive differences at Reward level 1' DRIVE -1 1 DRIVE*REWARD -1 0 0 1 0 0 /LMATRIX 'Drive differences at Reward level 2' DRIVE -1 1 DRIVE*REWARD 0 -1 0 0 1 0 /LMATRIX 'Drive differences at Reward level 3' DRIVE -1 1 DRIVE*REWARD 0 0 -1 0 0 1 /DESIGN = drive reward drive*reward . |
The l coefficients for the drive*reward interaction are
l6drive1reward1 + l7drive1reward2 + l8drive1reward3 + l9drive2reward1 + l10drive2reward2 + l11drive2reward3
The l coefficients at reward level 1 are l6 and l9, the coefficients at reward level 2 are l7 and l10, and the coefficients at reward level 3 are l8 and l11.
The effects within reward levels 1, 2 and 3 are shown in Tables 14, 15, and 16, respectively.
| Source | Sum of Squares | df | Mean Square | F | Sig. |
|---|---|---|---|---|---|
| Contrast | 128.000 | 1 | 128.000 | 6.982 | .017 |
| Error | 330.000 | 18 | 18.333 | ||
| a Computed using alpha = .05 | |||||
| Source | Sum of Squares | df | Mean Square | F | Sig. |
|---|---|---|---|---|---|
| Contrast | 8.000 | 1 | 8.000 | .436 | .517 |
| Error | 330.000 | 18 | 18.333 | ||
| a Computed using alpha = .05 | |||||
| Source | Sum of Squares | df | Mean Square | F | Sig. |
|---|---|---|---|---|---|
| Contrast | 32.000 | 1 | 32.000 | 1.745 | .203 |
| Error | 330.000 | 18 | 18.333 | ||
| a Computed using alpha = .05 | |||||
This view of the interaction suggests that drive level influenced behavior in the low reward condition (1 grape), F(1, 18) = 6.98, p = .017, but not in the moderate reward condition (3 grapes), F(1, 18) = 0.44, p = .517, or the high reward conditions (5 grapes), F(1, 18) = 1.74, p = .203. In the low reward condition performance was better under high drive (M = 3.0, SD = 3.2) then under low drive (M = 11.0, SD = 3.9).
Becker, L. A., & Coolidge, F. L. (1991). On the proper interpretation of residualized interaction means in an analysis of variance: A reply to Rosnow and Rosenthal. Psychological Reports, 68, 483-490.
Rosnow, R. L. & Rosenthal R. (1989). Definition and interpretation of interaction effects. Psychological Bulletin, 105, 143-146.
İLee A. Becker, 1997-1999 -revised 11/18/99