/* Monte Carlo study of the two-sample t-test check the violations of the assumptions 1. two independent samples 2. normal distributions 3. equal variance? */ /* Macro Variables used to initialize the simulation */ * Control Group; %let mean1 = 73; %let stdev1 = 2.5; %let n1 = 30; %let dist1 = 'normal'; * Treatment Group; %let mean2 = 72; %let stdev2 = 2.5; %let n2 = 30; %let dist2 = 'normal'; data normal1; do i=1 to &n1; drop i; x = rand(&dist1, &mean1, &stdev1); samp = 'C'; output normal1; end; *proc print data=normal1; *run; data normal2; do i=1 to &n2; drop i; x = rand(&dist2, &mean2, &stdev2); samp = 'T'; output normal2; end; *proc print data=normal2; *run; * merge the data into one dataset with the same variables; data normal; set normal1 normal2; run; *proc print data=normal; *run; *proc univariate; * by samp; *run; proc boxplot data=normal; plot x*samp / boxstyle=schematic boxwidth=15; run; proc ttest data=normal; class samp; var x; run;