Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: random number generator for gamma


From   "Tomas Lind" <tomas.lind@ki.se>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: random number generator for gamma
Date   Wed, 29 Sep 2010 14:48:54 +0200

Dear Statalist

I´ve been using the -rnd- ado-package from Hilbe/Linde-Zwirble (update from
STB-28: sg44).

The following syntax produces sensible results (mean and sd) when I generate
20000 Gamma distributed random numbers with shape=11.11 and scale=0.18

clear *   	
rndgam 20000 11.11  0.18		
summarize xg	// mean=2.0 sd=0.60	



However, with -rndgamx- I don´t get the same values. I have probably missed
something fundamental. Someone know what goes on?

clear *
set obs 20000
gen m=2		// mean=2			
rndgamx  m , s(11.11)		
summarize xg	// mean=247 sd=74


/Tomas




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index