/* It is recommended that you not cut and paste any of this code that comes after the datastep. It is intended as a model for you to look at when typing your own code. */ data ouch; input technician sunscreen $ @; do k=1 to 2; input y @; output; end; cards; 1 S1 8.2 7.6 2 S1 3.6 3.5 3 S1 10.7 10.3 4 S1 3.9 4.4 5 S1 12.9 12.1 6 S1 5.5 5.9 7 S1 9.1 9.7 8 S1 13.7 13.2 9 S1 8.1 8.7 10 S1 2.5 2.8 1 S2 6.1 6.8 2 S2 4.3 4.7 3 S2 9.6 9.2 4 S2 2.3 2.5 5 S2 12.4 12.8 6 S2 4.8 4.0 7 S2 8.3 8.6 8 S2 12.9 13.6 9 S2 8.0 7.5 10 S2 2.1 2.5 ; run; symbol1 i=join value=dot; proc means data=ouch nway noprint; /* nway suppresses marginal means */ class sunscreen technician; var y; output out=ouchmeans mean=ymean; run; symbol value=dot i=join; proc gplot data=ouchmeans; title "plot of means"; plot ymean*technician=sunscreen; plot ymean*sunscreen=technician; run; symbol value=dot i=none; proc gplot data=ouch; title "plot of individual subjects"; plot y*technician=sunscreen; plot y*sunscreen=technician; run; proc mixed data=ouch method=type3; class sunscreen technician; model y=sunscreen; random technician sunscreen*technician; lsmeans sunscreen/cl; run;