http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_mixed_sect030.htm */
/*This example comes directly from the PROC MIXED documentation. The experiement was a split-plot
in a RCBD. There are 3-levels of the whole-plot factor A, and 2-levels of the sub-plot factor B.
A total of 4-blocks were used. For a split-plot in a RCBD, the Numerator and Denominator
Degrees of freedom for testing the whole-plot and sub-plot factors are:
Factor Num DF Denom DF
A (whole-plot) (A-1)=2 (A-1)(Block-1)=6
B (Sub-plot) (B-1)=2 A(B-1)(Block-1)=9
A*B (A-1)(B-1)=2 A(B-1)(Block-1)=9
*/
data sp;
input Block A B Y @@;
datalines;
1 1 1 56 1 1 2 41
1 2 1 50 1 2 2 36
1 3 1 39 1 3 2 35
2 1 1 30 2 1 2 25
2 2 1 36 2 2 2 28
2 3 1 33 2 3 2 30
3 1 1 32 3 1 2 24
3 2 1 31 3 2 2 27
3 3 1 15 3 3 2 19
4 1 1 30 4 1 2 25
4 2 1 35 4 2 2 30
4 3 1 17 4 3 2 18
;
proc print;
run;
*(1) Correct;
*Split-Plot in RCBD (Sas online doc model);
proc mixed data=sp lognote;
class A B Block;
model Y = A B A*B;
random Block A*Block;
run;
*(2) Incorrect:
*Rearranged random terms!! TYPE III Tests for Whole-plot factor A are WRONG;
proc mixed data=sp lognote;
class A B Block;
model Y = A B A*B;
random A*Block Block;
run;
*(3) Partially Correct:
*Rearrange random terms look at ANOVA TABLE.
Correct error term,Den DF & p-value being used for A: MS(A*BLOCK),but wrong DF reported in 'Type 3 Tests of Fixed Effects';
proc mixed data=sp method=type3 lognote;
class A B Block;
model Y = A B A*B;
random A*Block Block;
run;
*(4) Correct:
rearrange random terms and use SATTERTHWAITES DF;
proc mixed data=sp lognote;
class A B Block;
model Y = A B A*B/ddfm=satterth;
random A*Block Block;
run;
*(5) Correct:
*Use repeated statement for A*Block and use SATTERTHWAITES DF;
proc mixed data=sp lognote;
class A B Block;
model Y = A B A*B/ddfm=satterth;
random Block;
repeated/subject=A*Block type=cs rcorr r;
run;
*****************************
Lewis Jordan
Weyerhaeuser:
Southern Timberlands R&D
Cell (Primary): 662-889-4514
Office: 662-245-5227
lewis.jordan@weyerhaeuser.com<mailto:lewis.jordan@weyerhaeuser.com>
*****************************