*NKNW892.sas, two-way anova with unequal numbers of observations using data in Table 22.1; options nocenter; data a1; infile 'u:\.www\datasets512\CH22TA01.DAT'; input growth gender bone; proc print data=a1; run; data a1; set a1; if (gender eq 1)*(bone eq 1) then gb='1_Msev '; if (gender eq 1)*(bone eq 2) then gb='2_Mmod '; if (gender eq 1)*(bone eq 3) then gb='3_Mmild'; if (gender eq 2)*(bone eq 1) then gb='4_Msev '; if (gender eq 2)*(bone eq 2) then gb='5_Mmod '; if (gender eq 2)*(bone eq 3) then gb='6_Mmild'; run; title1 'Plot of the data'; symbol1 v=circle i=none c=black; proc gplot data=a1; plot growth*gb/frame; run; proc means data=a1; output out=a2 mean=avgrowth; by gender bone; title1 'Plot of the means'; symbol1 v='M' i=join c=black; symbol2 v='F' i=join c=black; proc gplot data=a2; plot avgrowth*bone=gender/frame; run; proc glm data=a1; class gender bone; model growth=gender|bone/solution; means gender*bone; contrast 'gender Type III' gender 3 -3 gender*bone 1 1 1 -1 -1 -1; estimate 'gender Type III' gender 3 -3 gender*bone 1 1 1 -1 -1 -1; contrast 'gender Type I' gender 7 -7 bone 2 -1 -1 gender*bone 3 2 2 -1 -3 -3; estimate 'gender Type I' gender 7 -7 bone 2 -1 -1 gender*bone 3 2 2 -1 -3 -3; contrast 'bone Type III' bone 2 -2 0 gender*bone 1 -1 0 1 -1 0, bone 0 2 -2 gender*bone 0 1 -1 0 1 -1; contrast 'gender*bone Type I and III' gender*bone 1 -1 0 -1 1 0, gender*bone 0 1 -1 0 -1 1; run; proc glm data=a1; class gender bone; model growth=gender bone/solution; means gender bone/ tukey lines; run;