option ls=76 nocenter; data ex_4_4; input resistance et wafer position; datalines; 5.22 1 1 1 x 5.61 1 1 2 x 6.11 1 1 3 x 6.33 1 1 4 x 6.13 1 2 1 x 6.14 1 2 2 x 5.60 1 2 3 x 5.91 1 2 4 x 5.49 1 3 1 x 4.60 1 3 2 x 4.95 1 3 3 x 5.42 1 3 4 x 5.78 2 1 1 x 6.52 2 1 2 x 5.90 2 1 3 x 5.67 2 1 4 x 5.77 2 2 1 x 6.23 2 2 2 x 5.57 2 2 3 x 5.96 2 2 4 x 6.43 2 3 1 x 5.81 2 3 2 x 5.83 2 3 3 x 6.12 2 3 4 x 5.66 3 1 1 x 6.25 3 1 2 x 5.46 3 1 3 x 5.08 3 1 4 x 6.53 3 2 1 x 6.50 3 2 2 x 6.23 3 2 3 x 6.84 3 2 4 x 6.22 3 3 1 x 6.29 3 3 2 x 5.63 3 3 3 x 6.36 3 3 4 x 6.75 4 1 1 x 6.97 4 1 2 x 6.02 4 1 3 x 6.88 4 1 4 x 6.22 4 2 1 x 6.54 4 2 2 x 6.12 4 2 3 x 6.61 4 2 4 x 6.05 4 3 1 x 6.15 4 3 2 x 5.55 4 3 3 x 6.13 4 3 4 x ; proc mixed data=ex_4_4; class wafer et position; model resistance=et|position / ddfm=satterth; random wafer(et); lsmeans position / diff; estimate 'pos1 vs pos3' position 1 0 -1 0; contrast 'pos1 vs pos3' position 1 0 -1 0; estimate 'pos 3 vs others' position 1 1 -3 1 / divisor=3; estimate 'pos3 v oth - wrong' position 1 1 -3 1; contrast 'pos 3 vs others' position 1 1 -3 1; ods select Estimates Contrasts Diffs; run;