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: RE: random number generator for gamma


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: random number generator for gamma
Date   Wed, 29 Sep 2010 16:26:50 +0100

Joe Hilbe will no doubt answer this. Meanwhile official Stata has -rgamma()-. 

Nick 
[email protected] 

Tomas Lind

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


*
*   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