statistics/심리통계학의 기초

상호작용이 있는 것을 확인 한 후 단순주효과를 신텍스에서 입력하는 방법.

반찬이 2009. 6. 4. 17:44

일단 사이트 한 곳을 소개해 드립니다 .

영어이지만, 통계보다는 쉬울 듯. 해석해서 보도록 하세요.

 

사이트 주소 : http://web.uccs.edu/lbecker/SPSS/glm_sme.htm#top

 

 

-----------------------------------------------------------------

7. /LMATRIX Syntax for Simple Main Effects

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.

Table 6. GLM Syntax for a 2-way ANOVA
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.

Table 7. GLM Syntax for Simple Main Effect of Reward Within Low Drive
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.

Table 8. /LMATRIX Syntax for Simple Main Effect of Reward Within Low and High Drive
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.

top


8. /LMATRIX: Run the Simple Main Effects Analysis

To run the simple main effects analysis you simply Run, All the syntax commands from the Syntax dialog box.

top


9. /LMATRIX: Interpret the Output

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.

Table 9. Contrast Results (K Matrix)(a)
Simple Main Effect of Reward within Low Drive (1 hour deprived)

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.

Table 10. Test Results
Dependent Variable: Number correct on the 20 training trials
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.

Table 11. Contrast Results (K Matrix)(a)
Simple Main effect of Reward within High Drive (24 hours deprived)

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.

Table 12. Test Results
Dependent Variable: Number correct on the 20 training trials
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

top


9. /LMATRIX: Simple Main Effects of Drive Within Reward

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.

Table 13. GLM Syntax for Simple Main Effect of Drive Within Reward
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.

Table 14. Drive Differences Within Reward Level 1 (1 grape)
Dependent Variable: Number correct on the 20 training trials
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

 

Table 15. Drive Differences Within Reward Level 2 (3 grapes)
Dependent Variable: Number correct on the 20 training trials
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

 

Table 16. Drive Differences Within Reward Level 3 (5 grapes) Test Results
Dependent Variable: Number correct on the 20 training trials
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).

top


11. References

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.

 

 

 

-------------------------------------------------------------------

 

 

 

 

이원 변량분석일 경우,

두 개의 주효과와 한 개의 상호작용을 볼 수 있지요.

그런데, 한 개 이상의 주효과와 한 개의 상호작용이 나오게 되면,

해석할 때, 일단 상호작용에 집중해서 해석하게 됩니다.

상호작용이 유의하지 않으면 주효과만 봐도 되겠지만,

상호작용이 유의해야 그래도 논문을 쓰는 그 이유가 있거든요.

그래서, 상호작용이 나오면

단순주효과분석을 하게 됩니다.

그런데, 이걸 spss 애덜이 안 만들었어요.

신텍스(명령문)에서 작성해야 되요.

붙여넣기(paste)나, 명령문이라는 단추를 누르면,

syntax로 붙여넣어지거든요.

그거 실은 몇 줄 안됩니다. 그런데, 그 안에

/LMATRIX를 써서

어떤 것을 비교할지에 대해서

자신이 직접 입력해 줘야 해요.

그것에 대한 글이 바로 위에 사이트 소개 해 준 곳에서 보여주는 겁니다.

그 사이트에 sav 파일도 있으니 한번 분석해 보세요.