/* SAS Example of 3-factor ANOVA */ /* We use the stress data example we looked at in class. */ DATA stress; INPUT stresstest gender diet smoking subject; cards; 24.1 1 1 1 1 29.2 1 1 1 2 24.6 1 1 1 3 20.0 2 1 1 1 21.9 2 1 1 2 17.6 2 1 1 3 14.6 1 2 1 1 15.3 1 2 1 2 12.3 1 2 1 3 16.1 2 2 1 1 9.3 2 2 1 2 10.8 2 2 1 3 17.6 1 1 2 1 18.8 1 1 2 2 23.2 1 1 2 3 14.8 2 1 2 1 10.3 2 1 2 2 11.3 2 1 2 3 14.9 1 2 2 1 20.4 1 2 2 2 12.8 1 2 2 3 10.1 2 2 2 1 14.4 2 2 2 2 6.1 2 2 2 3 ; run; /* The ANOVA model with all interaction terms included: */ PROC GLM DATA=stress; CLASS gender diet smoking; MODEL stresstest = gender diet smoking gender*diet gender*smoking diet*smoking gender*diet*smoking; RUN; /* We see there is no significant 3-way interaction (P-value = 0.66). */ /* The is significant Diet*Smoking Interaction. */ /* We also see a significant effect due to gender. */ /* What is the effect of leaving out the highest-order interaction? */ PROC GLM DATA=stress; CLASS gender diet smoking; MODEL stresstest = gender diet smoking gender*diet gender*smoking diet*smoking; RUN;