data pest; input variety pesticide yield; lines; 1 1 49 1 1 39 1 2 50 1 2 55 1 3 38 2 1 55 2 1 41 2 2 58 2 3 53 2 3 42 2 2 67 ; proc print; run; proc glm data=pest; class variety pesticide; model yield=variety pesticide variety*pesticide/solution; run; proc glm data=pest; class pesticide variety; model yield=variety pesticide variety*pesticide/solution; lsmeans variety*pesticide; estimate "v2-v1|pesticide=1" variety -1 1 variety*pesticide -1 1 0 0 0 0; estimate "P2-P1|v=1" pesticide 0 1 -1 variety*pesticide 0 0 1 0 -1 0; run; proc glm data=pest; class variety pesticide; model yield=variety pesticide variety*pesticide/solution; estimate "v2-v1|pesticide=1" variety -1 1 variety*pesticide -1 1 0 0 0 0; run;