options ls=75 nodate; data one; *infile "blsugar.dat" firstobs=2 dlm='09'x; input a b rep y; drug=a; admin=b; cards; 1 1 1 18 1 2 1 23 2 1 1 20 2 2 1 17 3 1 1 30 3 2 1 33 1 1 2 16 1 2 2 19 2 1 2 19 2 2 2 15 3 1 2 28 3 2 2 36 1 1 3 13 1 2 3 17 2 1 3 21 2 2 3 20 3 1 3 26 3 2 3 30 run; /*proc sort; by a; run; proc means mean var; by a; class b; var y; run;*/ proc glm; class a b; model y=a b(a); output out=two p=p r=r; means a b(a)/lsd; estimate "effect of B within A=1" b(a) -1 1; estimate "effect of B within A=2" b(a) 0 0 -1 1; estimate "effect of B within A=3" b(a) 0 0 0 0 -1 1; estimate "A=1 mean - A=2 mean" a 1 -1; estimate "A=1 mean - A=3 mean" a 1 0 -1; estimate "A=2 mean - A=3 mean" a 0 1 -1; estimate "theta1" a -0.5 -0.5 1 b(a) -0.25 -0.25 -0.25 -0.25 1; estimate "theta2" a -0.5 -0.5 1 b(a) -0.25 -0.25 -0.25 -0.25 0 1; lsmeans b(a)/slice=a; run; proc gplot; plot r*p; run; proc univariate normal; histogram r; var r; run;