Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: random number generator for gamma


From   "Tomas Lind" <[email protected]>
To   <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index