* MANOVA DATA FROM MORRISONS MULTIVARIATE TEXT, 2ND EDITION, PAGE 190; Title 'Two Way Manova Example: Power analysis'; 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 weight loss' Y2='Week2 weight loss'; input sex $ drug $ @; *<-- read several obs. per line; do rat=1 to 4; input y1 y2 @; output; end; datalines; 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 ; proc summary data=drugs nway; class sex drug; var Y1 Y2; output out=means mean=Y1 Y2; proc plot data=means; plot Y2 * Y1 = drug; PROC GLM data=drugs outstat=stats; CLASS sex drug; MODEL Y1 Y2 = sex drug sex*drug / ss1 nouni; MANOVA H=sex drug sex*drug / SHORT; proc print data=stats; title2 'OUTSTAT= data set'; run; *include macros(mpower); title2 'Retrospective power analysis'; %mpower(data=stats, yvar=Y1 Y2);