proc iml; options nodate pagesize=60 linesize=80; *This program generates a sampling distribution of means from a Uniform distribution. You need to input parameters max to set the upper bound of the distribution (0 is the minimum). N (sample size) and number of samples Nsam; *input max, the upper limit of the population distribution; max = 10; *Input the sample size per sample for the sampling distribution; N=50; *Input the number of samples to be included in the sampling distribution; Nsam=1000; out1 = j(Nsam,1,-999); do h=1 to Nsam; * Set for Nsam iterations; sample = uniform(j(N,1,0)); *print sample; sample = sample*max; *print sample; mean=sample[+,]/N; out1[h,]=mean; end; *create output datasets; create out2 from out1; append from out1; quit; data d2; set out2; *If you want to save the distribution, write to an external file; *file 'c:/sas/mike/corrs'; *put col1 8.4; proc univariate plot normal; run;