/* This example shows the analysis for the Latin Square experiment */ /* using the productivity data example we looked at in class */ /* Entering the data and defining the variables: */ DATA productivity; INPUT OBS MUSIC $ DAY TIME PRODUCT; CARDS; 1 A 1 1 6.3 2 B 1 2 9.8 3 C 1 3 14.3 4 D 1 4 12.3 5 E 1 5 9.1 6 B 2 1 7.7 7 C 2 2 13.5 8 D 2 3 13.4 9 E 2 4 12.6 10 A 2 5 9.9 11 C 3 1 11.7 12 D 3 2 10.7 13 E 3 3 13.8 14 A 3 4 9.0 15 B 3 5 10.3 16 D 4 1 9.0 17 E 4 2 10.5 18 A 4 3 9.3 19 B 4 4 9.8 20 C 4 5 12.0 21 E 5 1 4.5 22 A 5 2 5.3 23 B 5 3 8.4 24 C 5 4 9.6 25 D 5 5 11.0 ; run; /*******************************************************************************/ /* The PROC GLM syntax is familiar here. MUSIC, DAY and TIME are factors. */ /* PRODUCT is the response variable, MUSIC is the treatment factor, */ /* and TIME and DAY are the row and column factors. Note there is no RANDOM */ /* statement, since the levels of TIME and DAY are not really a random sample. */ PROC GLM data=productivity; CLASS MUSIC DAY TIME; MODEL PRODUCT = MUSIC DAY TIME; MEANS MUSIC / ALPHA=0.05 TUKEY; MEANS MUSIC / ALPHA=0.05 TUKEY CLDIFF; RUN; /* From the F-tests and their P-values, there is a significant effect of music type */ /* on mean productivity. We also see a significant row (TIME) effect and column (DAY) */ /* effect. Tukey's procedure tells us which pairs of music types are significantly */ /* different. */