data; input blk trt Y; cards; 1 1 73 1 3 73 1 4 75 2 1 74 2 2 75 2 3 75 3 2 67 3 3 68 3 4 72 4 1 71 4 2 72 4 4 75 ;;;; /*This data is from Example 4-5 in Montgomery, Design and Analysis of experiments, 6th edition, */ /* Wiley, 2005, pages 147-154. This demonstrates the recovery of interblock information when */ /* the blocks are considered random. */ proc glm; class trt blk; model Y = blk trt; lsmeans trt/ e stderr pdiff; proc mixed; class trt blk; model Y = trt; random blk; lsmeans trt/ e pdiff; /* The next 4 estimate statements calculate the treatment effects from the solution*/ estimate "trt effect 1" trt +.75 -.25 -.25 -.25/e; estimate "trt effect 2" trt -.25 +.75 -.25 -.25/e; estimate "trt effect 3" trt -.25 -.25 +.75 -.25/e; estimate "trt effect 4" trt -.25 -.25 -.25 +.75/e; /* The next 3 contrast statements show one set of orthogonal contrasts*/ contrast "trt1 vs trt2-4" trt 3 -1 -1 -1; contrast "trt2 vs trt3-4" trt 0 2 -1 -1 ; contrast "trt3 vs trt4" trt 0 0 1 -1 ; run;