* ch21eg.sas, illustrate RCBD using data of Table 21.1; options ls=78 nodate; ; * illustrate possible randomization; data randomiz; do block=1 to 5; do trtmt=1 to 3; u=ranuni(555); output; end; end; proc sort; by block u; proc print; var block trtmt u; title 'Example randomization for RCBD: 5 blocks, 3 trtmts'; ; data RiskPrem; input y block method; lines; 1 1 1 5 1 2 8 1 3 2 2 1 8 2 2 14 2 3 7 3 1 9 3 2 16 3 3 6 4 1 13 4 2 18 4 3 12 5 1 14 5 2 17 5 3 ; * plot the raw data; proc plot; plot y*block=method / vpos=18; plot y*method=block / vpos=18; title 'Risk Premium Experiment (chapter 21, page 895)'; title2 'Plot of raw data'; ; * analysis of RCBD data; proc glm; class block method; model y = block method; means method / Tukey; output out=stats r=e p=yhat; title2 'Analysis of RCBD data'; ; * Residual plots; proc rank normal=Blom; var e; ranks nscore; proc plot; plot e*yhat=method / vpos=18 vref=0; plot e*block=method / vpos=18 vref=0; plot e*method=block / vpos=18 vref=0; plot e*nscore=method / vpos=18 vref=0; title2 'Residual plots'; Example randomization for RCBD: 5 blocks, 3 trtmts 1 Obs block trtmt u 1 1 2 0.39924 2 1 1 0.65423 3 1 3 0.90249 4 2 2 0.48943 5 2 3 0.94893 6 2 1 0.96625 7 3 2 0.08891 8 3 1 0.35344 9 3 3 0.63568 10 4 2 0.72181 11 4 3 0.74814 12 4 1 0.94444 13 5 3 0.14824 14 5 2 0.28744 15 5 1 0.63384 Risk Premium Experiment (chapter 21, page 895) 2 Plot of raw data Plot of y*block. Symbol is value of method. y 18 + 3 17 + 3 16 + 3 15 + 14 + 3 2 13 + 2 12 + 1 11 + 10 + 9 + 2 8 + 3 2 7 + 1 6 + 1 5 + 2 4 + 3 + 2 + 1 1 + 1 ---+--------------+--------------+--------------+--------------+-- 1 2 3 4 5 block Risk Premium Experiment (chapter 21, page 895) 3 Plot of raw data Plot of y*method. Symbol is value of block. y 18 + 4 17 + 5 16 + 3 15 + 14 + 5 2 13 + 4 12 +5 11 + 10 + 9 + 3 8 + 2 1 7 +3 6 +4 5 + 1 4 + 3 + 2 +2 1 +1 -+-----------------------------------+-----------------------------------+- 1 2 3 method Risk Premium Experiment (chapter 21, page 895) 4 Analysis of RCBD data The GLM Procedure Class Level Information Class Levels Values block 5 1 2 3 4 5 method 3 1 2 3 Number of Observations Read 15 Number of Observations Used 15 Risk Premium Experiment (chapter 21, page 895) 5 Analysis of RCBD data The GLM Procedure Dependent Variable: y Sum of Source DF Squares Mean Square F Value Pr > F Model 6 374.1333333 62.3555556 20.90 0.0002 Error 8 23.8666667 2.9833333 Corrected Total 14 398.0000000 R-Square Coeff Var Root MSE y Mean 0.940034 17.27233 1.727233 10.00000 Source DF Type I SS Mean Square F Value Pr > F block 4 171.3333333 42.8333333 14.36 0.0010 method 2 202.8000000 101.4000000 33.99 0.0001 Source DF Type III SS Mean Square F Value Pr > F block 4 171.3333333 42.8333333 14.36 0.0010 method 2 202.8000000 101.4000000 33.99 0.0001 Risk Premium Experiment (chapter 21, page 895) 6 Analysis of RCBD data 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 2.983333 Critical Value of Studentized Range 4.04104 Minimum Significant Difference 3.1215 Means with the same letter are not significantly different. Tukey Grouping Mean N method A 14.600 5 3 B 9.800 5 2 C 5.600 5 1 Risk Premium Experiment (chapter 21, page 895) 7 Residual plots Plot of e*yhat. Symbol is value of method. e | 2 + 1 | | 3 | | 3 | 1 1 2 3 | 2 | 2 0 +----------------------------------------------------------------- | 2 | | | | 3 | 1 2 | -2 + 1 3 ---+--------------+--------------+--------------+--------------+-- 0 5 10 15 20 yhat Risk Premium Experiment (chapter 21, page 895) 8 Residual plots Plot of e*block. Symbol is value of method. e | 2 + 1 | | 3 | | 3 | 1 1 2 | 2 | 2 0 +----------------------------------------------------------------- | 2 | | | | 3 | 1 2 | -2 + 1 3 ---+--------------+--------------+--------------+--------------+-- 1 2 3 4 5 block NOTE: 1 obs hidden. Risk Premium Experiment (chapter 21, page 895) 9 Residual plots Plot of e*method. Symbol is value of block. e | 2 +5 | | 2 | | 4 |1 4 3 | 1 | 2 0 +-------------------------------------------------------------------------- | 5 | | | | 1 |2 3 | -2 +4 5 -+-----------------------------------+-----------------------------------+- 1 2 3 method NOTE: 1 obs hidden. Risk Premium Experiment (chapter 21, page 895) 10 Residual plots Plot of e*nscore. Symbol is value of method. e | 2 + 1 | | 3 | | 3 | 1 1 2 | 2 | 2 0 +-------------------------------------------------------------------------- | 2 | | | | 3 | 1 2 | -2 + 3 1 -+--------+--------+--------+--------+--------+--------+--------+--------+- -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 Rank for Variable e NOTE: 1 obs hidden.