/* Monte Carlo study of the one-way ANOVA check the violations of the assumptions 1. two independent samples 2. normal distributions 3. equal variance? */ /* Macro Variables used to initialize the simulation */ * Group 1; %let mean1 = 73; %let stdev1 = 2.5; %let n1 = 30; %let dist1 = 'normal'; * Group 2; %let mean2 = 72; %let stdev2 = 2.5; %let n2 = 30; %let dist2 = 'normal'; * Group 3; %let mean3 = 64; %let stdev3 = 2; %let n3 = 30; %let dist3 = 'normal'; data normal1; do i=1 to &n1; drop i; x = rand(&dist1, &mean1, &stdev1); samp = 'A'; output normal1; end; *proc print data=normal1; *run; data normal2; do i=1 to &n2; drop i; x = rand(&dist2, &mean2, &stdev2); samp = 'B'; output normal2; end; *proc print data=normal2; *run; data normal3; do i=1 to &n3; drop i; x = rand(&dist3, &mean3, &stdev3); samp = 'C'; output normal3; end; *proc print data=normal3; *run; * merge the data into one dataset with the same variables; data normal; set normal1 normal2 normal3; run; *proc print data=normal; *run; proc univariate; by samp; run; proc boxplot data=normal; plot x*samp / boxstyle=schematic boxwidth=15; run; proc anova data=normal; class samp; model x = samp; means samp / SNK SCHEFFE ALPHA=0.1; run;