/* SAS Example for Generalized Random Block Design */ /* We analyze the Task Completion data in Section 21.7. */ DATA taskcomp; INPUT time gender distract subject; cards; 12 1 1 1 8 1 1 2 7 1 1 3 5 1 1 4 3 2 1 1 9 2 1 2 5 2 1 3 9 2 1 4 14 1 2 1 16 1 2 2 15 1 2 3 13 1 2 4 11 2 2 1 9 2 2 2 10 2 2 3 14 2 2 4 ; run; /* The response is time required to complete a task. */ /* Gender will serve as the blocking factor here. */ /* In the data above, 1 = male and 2 = female. */ /* Distraction level is the treatment factor of primary interest. */ /* In the data, 1 = low distraction, 2 = high distraction. */ /* There are d = 4 observations per trt-block combination, */ /* so we use a generalized random block model. */ /* The block levels are clearly fixed in this case (why?). */ /* The distraction levels are also fixed. */ /* We analyze the data with PROC GLM as usual: */ PROC GLM DATA=taskcomp; CLASS gender distract; MODEL time = distract gender distract*gender; RUN; /* We see a significant effect due to distraction */ /* (F* = 20.17, P-value = .0007). */ /* Since there are only 2 levels of distraction, */ /* there is no need for further comparisons. */