/* SAS example for analyzing a BIBD */ /* These are the taste test data from class and from chapter 28. */ DATA taste; INPUT block formulation rating; cards; 1 1 6 1 2 6 1 3 8 2 1 3 2 2 7 2 4 7 3 1 6 3 2 8 3 5 6 4 1 3 4 3 5 4 4 6 5 1 6 5 3 9 5 5 6 6 1 3 6 4 6 6 5 4 7 2 8 7 3 9 7 4 6 8 2 7 8 3 7 8 5 3 9 2 7 9 4 5 9 5 3 10 3 10 10 4 9 10 5 6 ; run; /* We use PROC MIXED to analyze the data from the BIBD. */ /* If blocks are considered random, we put block in the */ /* RANDOM statement and not in the MODEL statement: */ PROC MIXED DATA = taste; CLASS block formulation; MODEL rating = formulation; RANDOM block; LSMEANS formulation / PDIFF CL ADJUST = TUKEY; run; /* The significant effect due to formulation is seen in the */ /* "Type 3 Tests of Fixed Effects" section of the output. */ /* (F* = 16, P-value < .0001) */ /* From the Tukey simultaneous comparisons, we see: */ /* Treatments 1 and 5 are not significantly different, */ /* Treatments 2 and 3 are not significantly different, */ /* Treatments 2 and 4 are not significantly different, */ /* Treatments 3 and 4 are not significantly different, */ /* All other pairs of treatment means are significantly different. */ /* This uses a 0.05 family significance level (the SAS default). */ /* ****************************************************** */ /* If blocks are considered fixed, we put block in the */ /* MODEL statement and omit any RANDOM statement: */ PROC MIXED DATA = taste; CLASS block formulation; MODEL rating = formulation block; LSMEANS formulation / PDIFF CL ADJUST = TUKEY; run; /* The significant effect due to formulation is seen in the */ /* "Type 3 Tests of Fixed Effects" section of the output. */ /* (F* = 15.66, P-value < .0001) */ /* There is also a significant block effect (F* = 5.56, P-value = .0015) */