Hello, I am trying to simulate data from a gamma distribution. I originally used the RAND function, from my understanding this is a newer function. However, I also tried the older function RANGAM. When using the same shape (and scale) parameters I get very different graphs when plotting the data. I'm obviously not understanding something correctly, could anyone advise on why one would use RAND vs. RANDGAM? I assumed there really shouldn't be any major differences. Sample Code I tried %let shape =0.15; %let scale = 0.25; data test; do i = 1 to 1000; do until (x>=0.2); xnew=&scale.*rand("Gamma", &shape.); xold=&scale.*randgam(1,&shape.); end; output; end; run; proc univariate data=test; var xnew xold; histogram/gamma; inset gamma/pos=ne; run; The data I'm trying to simulate needs to have a lower bound no less than 0.2, which is why I have the do until loop above. I'm hoping this is appropriate. Thanks in advance for any help you can provide!
... View more