Search code examples
spss

SPSS Split file syntax that works before is ignored in general linear models


I am trying to do general linear model analysis using SPSS syntax coding. I wrote a syntax to split my file and then apply GLM. This code used to work perfectly for my other variables in the same dataset but today when I look at the output file I can see that the code is ignoring the split command. Even the previous ones are not working anymore. Could you please help me with this? The syntax is below. SW_CODE is the variable (0- 1) that I like to split. Am I missing something?

sort cases by SW_CODE. 
split file by SW_CODE. 
GLM ATTITUDE_2 BY SW_CODE COND_CODE newfactor 
/METHOD = SSTYPE(3) 
/INTERCEPT = INCLUDE 
/PRINT = DESCRIPTIVE 
/CRITERIA = ALPHA(.05) 
/EMMEANS=TABLES(newfactor*COND_CODE) compare (newfactor) /DESIGN. 
split file off.

IF you can help me fix this I'd appreciate it.

Thanks in advance.


Solution

  • Remove SW_CODE variable from the GLM syntax and it should work as intended.

    sort cases by SW_CODE.
    split file by SW_CODE.
    GLM ATTITUDE_2 BY SW_CODE COND_CODE newfactor

    The way you wrote it makes it impossible for SPSS to test an effect of SW_CODE while spliting database by level of same variable