* ch22eg2.sas, illustrate RCBD using ANCOVA data of Table 22.1; options ls=78 nodate; ; * input the data sorted by x, assigning blocks; data promo; input y x A block; lines; 21 16 3 1 27 18 2 1 33 19 1 1 38 21 1 2 36 22 1 3 24 23 3 2 34 25 2 2 39 26 1 4 38 26 2 3 45 28 1 5 38 29 2 4 32 29 3 3 28 29 3 4 31 30 3 5 43 34 2 5 ; * print the data by block; proc sort; by block A; proc print; var block A y x; title 'Comparing RCBD to ANCOVA: Cracker Promotion Example'; title2 'Raw data by block and treatment'; ; * plot the raw data; proc plot; plot y*block=A / vpos=25; title2 'Plot of raw data'; ; * analysis of data as if collected using a RCBD; proc glm; class block A; model y = block A; means A / Tukey; output out=stats r=e p=yhat; title2 'Analysis of data as if from a RCBD'; Comparing RCBD to ANCOVA: Cracker Promotion Example 1 Raw data by block and treatment Obs block A y x 1 1 1 33 19 2 1 2 27 18 3 1 3 21 16 4 2 1 38 21 5 2 2 34 25 6 2 3 24 23 7 3 1 36 22 8 3 2 38 26 9 3 3 32 29 10 4 1 39 26 11 4 2 38 29 12 4 3 28 29 13 5 1 45 28 14 5 2 43 34 15 5 3 31 30 Comparing RCBD to ANCOVA: Cracker Promotion Example 2 Plot of raw data Plot of y*block. Symbol is value of A. y 45 + 1 44 + 43 + 2 42 + 41 + 40 + 39 + 1 38 + 1 2 2 37 + 36 + 1 35 + 34 + 2 33 + 1 32 + 3 31 + 3 30 + 29 + 28 + 3 27 + 2 26 + 25 + 24 + 3 23 + 22 + 21 + 3 ---+--------------+--------------+--------------+--------------+-- 1 2 3 4 5 block Comparing RCBD to ANCOVA: Cracker Promotion Example 3 Analysis of data as if from a RCBD The GLM Procedure Class Level Information Class Levels Values block 5 1 2 3 4 5 A 3 1 2 3 Number of Observations Read 15 Number of Observations Used 15 Comparing RCBD to ANCOVA: Cracker Promotion Example 4 Analysis of data as if from a RCBD The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 6 601.8666667 100.3111111 18.02 0.0003 Error 8 44.5333333 5.5666667 Corrected Total 14 646.4000000 R-Square Coeff Var Root MSE y Mean 0.931106 6.980410 2.359378 33.80000 Source DF Type I SS Mean Square F Value Pr > F block 4 263.0666667 65.7666667 11.81 0.0019 A 2 338.8000000 169.4000000 30.43 0.0002 Source DF Type III SS Mean Square F Value Pr > F block 4 263.0666667 65.7666667 11.81 0.0019 A 2 338.8000000 169.4000000 30.43 0.0002 Comparing RCBD to ANCOVA: Cracker Promotion Example 5 Analysis of data as if from a RCBD The GLM Procedure Tukey's Studentized Range (HSD) Test for y NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. Alpha 0.05 Error Degrees of Freedom 8 Error Mean Square 5.566667 Critical Value of Studentized Range 4.04104 Minimum Significant Difference 4.2639 Means with the same letter are not significantly different. Tukey Grouping Mean N A A 38.200 5 1 A A 36.000 5 2 B 27.200 5 3