To request a blog written on a specific topic, please email James@StatisticsSolutions.com with your suggestion. To view our SPSS video tutorials become a member here. Thank you!
Showing posts with label anova. Show all posts
Showing posts with label anova. Show all posts

Friday, September 7, 2012

Two-Way ANOVA Interactions in SPSS


Typically, when conducting an ANOVA, we can get the pairwise comparison results for the differences between the groups on the dependent variable. However, when we step it up to two grouping variables, SPSS tends to not give us this option.  
            For example, let’s say you wanted to test for difference in “Test Scores” by gender (male vs. female) and by ethnicity (white vs. black vs. Hispanic). In the Options… dialogue box in SPSS, you can move over Gender, Ethnicity, and Gender*Ethnicity. This will give the marginal means and standard errors for each of the groups. However, if you select the box “Compare main effects”, you will only get comparisons by Gender and by Ethnicity, not by the combination.  The secret to getting the main effects comparison is in examining the syntax. So first “Paste” the analysis into a Syntax file. It should look something like what is below:

UNIANOVA TestScores BY Gender Ethnicity
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(Gender) COMPARE
  /EMMEANS=TABLES(Ethnicity) COMPARE
  /EMMEANS=TABLES(Gender*Ethnicity)
  /CRITERIA=ALPHA(.05)
  /DESIGN=Gender Ethnicity Gender*Ethnicity.

            From the above you can see that SPSS did not add the “COMPARE” syntax to the Gender*Ethnicity means. In order to conduct the comparisons, we have to manually add it. However, simply adding “COMPARE” is not enough. Because it is an interaction, you have to specify what you want to compare. So it should be changed into what is below:

UNIANOVA TestScores BY Gender Ethnicity
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(Gender) COMPARE
  /EMMEANS=TABLES(Ethnicity) COMPARE
  /EMMEANS=TABLES(Gender*Ethnicity) COMPARE (Gender)
  /CRITERIA=ALPHA(.05)
  /DESIGN=Gender Ethnicity Gender*Ethnicity.

            What this will do is it will compare the Test Scores by gender for each ethnicity separately. But what about comparing the ethnicity for each gender? That simply requires another line in the syntax, which is below. However, conducting all these pairwise comparisons is going to affect Type I error. We may have some significant differences there that may be only significant due to random chance. In order to adjust for Type I error, we can include the Bonferroni adjustment the the comparisons. So the final syntax below has both two-way interactions examined with a Bonferonni adjustment added onto the p-values to adjust for Type I error.

UNIANOVA TestScores BY Gender Ethnicity
  /METHOD=SSTYPE(3)
  /INTERCEPT=INCLUDE
  /EMMEANS=TABLES(Gender) COMPARE ADJ(BONFERRONI)
  /EMMEANS=TABLES(Ethnicity) COMPARE ADJ(BONFERRONI)
  /EMMEANS=TABLES(Gender*Ethnicity) COMPARE (Gender) ADJ(BONFERRONI)
  /EMMEANS=TABLES(Gender*Ethnicity) COMPARE (Ethnicity) ADJ(BONFERRONI)

  /CRITERIA=ALPHA(.05)
  /DESIGN=Gender Ethnicity Gender*Ethnicity.

            To make things visual, you can make a bar chart using the estimated marginal means so you might have something like the chart below.