*NKNW698.sas, one way anova using data in Table 16.1; options nocenter; data a1; infile 'U:\.www\datasets512\CH16TA01.DAT'; input cases design store; *output here includes mean for each design and mean of all 19 cases. This overall mean will not be the same as the average of the treatment means because the n_i's are not equal; proc means data=a1 noprint; class design; var cases; output out=a2 mean=mclass; run; proc print data=a2; run; *this output will give the mean of the four group means. The where statement throws out the first row; proc means data=a2 mean; where _TYPE_ eq 1; var mclass; run; *this is an alternative way to generate the dummy variables. The if/then statement was used in the HW; data a1; set a1; x1=(design eq 1)-(design eq 4); x2=(design eq 2)-(design eq 4); x3=(design eq 3)-(design eq 4); proc print data=a1; run; *run the regression; proc reg data=a1; model cases=x1 x2 x3; run; *run the ANOVA; proc glm data=a1; class design; model cases=design; run;