proc iml; /* Create vector according to the provided pdf */ x = j(20*.6,1,"U")//j(20*.3,1,"M")//j(20*.1,1,"PhD"); /* Generate frequency table */ call tabulate(labels,freq,x); freq = freq/nrow(x); print freq[colname=labels]; /* Random sample from normal distribution */ y = j(50,1,.); call randgen(y,"Normal",2,2); sum_y = mean(y) || sqrt(var(y)); print sum_y; /* Generate 5 samples */ do i=1 to 5; y = j(50,1,.); call randgen(y,"Normal",2,2); sum_y_tmp = mean(y) || sqrt(var(y)); if i=1 then sum_y5 = sum_y_tmp; else sum_y5 = sum_y5//sum_y_tmp; end; print sum_y5; /* Generate sample with 10,000 observations */ y = j(10000,1,.); call randgen(y,"Normal",2,2); sum_many = mean(y) || sqrt(var(y)); print sum_many; quit;