Hi Rick,
Please, after reading your post I have began to learn how to IML for simulation
The following program works perfectly well; it gives me what I want. However, in data step, I can easily create sample ID using a do "rep=1 to m" and analyze by that sample ID. By sample ID, I mean replicate. How do I generate the sample ID (replicate) in IML so that I can analyze my data by sample ID?
Thanks in advance:
proc iml; call randseed(1);
sigma = 0.5; /* scale parameter */ E = j(1000, 1); call randgen(E, "Exponential", sigma); /* E ~ Expo(0.5) */ G = j(1000, 1); call randgen(G, "Gamma", 2, sigma); /* G ~ Gamma(2, 0.5) */
create test var {E G}; append; close;
quit;
proc univariate data=test; histogram E / exponential(scale=EST) endpoints=(0 to 5 by 0.25); histogram G / gamma(shape=EST scale=EST) endpoints=(0 to 5 by 0.25); run;
... View more