%newsas(nwk25t06); title 'Two-way ANCOVA: NWK Table 25.06 (Saleable flowers)'; data flowers; label A ='Flower variety' B ='Moisture level' X ='Plot size' Y ='Yield'; input A $ B @; * Read factor levels ; do REP = 1 to 6; input Y X @; * Read Y & X ; output; end; list; datalines; LP 1 98 15 60 4 77 7 80 9 95 14 64 5 LP 2 71 10 80 12 86 14 82 13 46 2 55 3 WB 1 55 4 60 5 75 8 65 7 87 13 78 11 WB 2 76 11 68 10 43 2 47 3 62 7 70 9 ; proc print; by A B; id A B; title2 'Original Data'; proc summary; var X Y; class A B; output out=sumry mean=X Y; proc print; by _type_; id _type_; proc GLM data=flowers; class A B; model Y = A B A*B X / solution; lsmeans A B A*B / stderr; *-- Adjusted means; title2 'ANCOVA model (Type III SS)'; title3 'Compare Table 23.12'; run;