MACRO permute d s results # approximate randomization: re-assigns data to groups calculates # and plots differences of group means # # data is stacked in d subscripts are in s # # copyright 2005 Robert L. Raymond University of St Thomas. Free use for # teaching and noncommercial research-retain this notice in this and derivative works MCOLUMN d s news new1 new2 results inp MCONSTANT reps ntotal k NOECHO # NOTE NOTE How many replications ? SET inp; FILE 'TERMINAL'; NOBS 1. LET reps = inp(1) LET ntotal = COUNT(d) # DO k = 1:reps SAMPLE ntotal s news COPY d new1; USE news = 1. COPY d new2; USE news = 2. LET results(k) = MEAN(new1) - MEAN(new2) ENDDO HISTOGRAM results; TITLE 'Differences of Means'. ECHO ENDMACRO