options ls=75; data one; input brand cooler @; do time=1 to 3; input avgrate @; output; end; cards; 1 1 62 57 51 1 2 66 46 58 1 3 62 47 54 1 4 47 45 40 2 5 59 52 56 2 6 53 54 51 2 7 54 52 43 2 8 55 38 48 3 9 66 50 59 3 10 63 54 51 3 11 53 50 41 3 12 56 47 57 ; proc gplot; title "scatterplots of raw data"; plot avgrate*time=brand; run; symbol1 i=join value=dot; proc gplot; by brand; title "Cooler effects?"; plot avgrate*time=cooler; run; /* In PROC MEANS, NOPRINT suppress output, NWAY keeps means only for combos of time brand, not marginal brand means or marginal time means */ proc means noprint nway; class time brand; var avgrate; output out=onemeans mean=m; run; proc gplot data=onemeans; title "scatterplot of treatment means"; plot m*time=brand; run; proc glm data=one; class time brand cooler; model avgrate=brand|time cooler(brand); test h=brand e=cooler(brand); run; /* all can be done in PROC MIXED */ proc mixed method=type3 data=one; class time brand cooler; model avgrate=time|brand/ddfm=satterth; random cooler(brand); lsmeans time brand/adj=tukey; run;