* MANOVA DATA FROM MORRISONS MULTIVARIATE TEXT, 2ND EDITION, PAGE 190; Title 'Two Way Manova Example'; *options validvarname=upcase; DATA drugs; * Rats are given one of 3 types of drug. weight loss (grams) * is the dependent measure over two weeks (Y1, Y2); Label Y1='Week1' Y2='Week2'; INPUT sex $ drug $ @; *<-- read several obs. per line; INPUT Y1 Y2 @; OUTPUT; INPUT Y1 Y2 @; OUTPUT; INPUT Y1 Y2 @; OUTPUT; INPUT Y1 Y2 @; OUTPUT; LIST; CARDS; M A 5 6 5 4 9 9 7 6 M B 7 6 7 7 9 12 6 8 M C 21 15 14 11 17 12 12 10 F A 7 10 6 6 9 7 8 10 F B 10 13 8 7 7 6 6 9 F C 16 12 14 9 14 8 10 5 ; ods listing close; PROC GLM outstat=stats; CLASSES sex drug; MODEL Y1 Y2 = sex drug sex*drug /nouni ss3; run; ods listing; *include goptions; goptions htext=1.6 vpos=60 hpos=100 vsize=7in; proc print data=stats; title "H and E Covariance for Sex Effect"; *-- specify an axis to scale H,V equally; %gdispla(OFF); *options mprint; axis1 order=(0 to 20 by 5); axis2 order=(0 to 16 by 4) label=(a=90 r=0); legend1 position=(bottom center inside) offset=(0,1) mode=share frame; %heplot(data=drugs, stat=stats, var=Y1 Y2, effect=SEX, haxis=axis1, vaxis=axis2, legend=legend1); %gskip; title "Drug Effect"; %heplot(data=drugs, stat=stats, var=Y1 Y2, effect=Drug, haxis=axis1, vaxis=axis2, legend=legend1); %gskip; title "Sex*Drug Effect"; %heplot(data=drugs, stat=stats, var=Y1 Y2, effect=Sex*Drug, haxis=axis1, vaxis=axis2, legend=legend1); data drugs; set drugs; group = trim(sex) || '-' || drug; run; title 'Data'; axis1 order=(0 to 20 by 5) offset=(1,5); axis2 order=(0 to 16 by 4) label=(a=90 r=0); %ellipses(data=drugs, x=Y1, y=Y2, class=group, haxis=axis1, vaxis=axis2, colors=red red red blue blue blue, pvalue=0.5, symbols=dot circle square dot circle square); proc print data=contour(firstobs=205); *goptions hsize= vsize=; %gdispla(ON); %panels(rows=2,cols=2, plots=4, order=down); /* %gdispla(OFF); axis1 order=(-20 to 20 by 10); title "Sex Effect"; legend1 position=(bottom center inside) offset=(0,1) mode=share frame; %heplot(data=stats, var=Y1 Y2, effect=SEX, haxis=axis1, legend=legend1, M1=H+E); title "Drug Effect"; %heplot(data=stats, var=Y1 Y2, effect=Drug, haxis=axis1, legend=legend1, M1=H+E); title "Sex*Drug Effect"; %heplot(data=stats, var=Y1 Y2, effect=Sex*Drug, haxis=axis1, legend=legend1, M1=H+E); %gdispla(ON); goptions hsize= vsize=; %panels(rows=2,cols=2, plots=3, order=down, first=-3); */