--- On Mon, 22/6/09, Carlo Lazzaro wrote:
> you can use -invibeta- for creating random observation with
> given parameters a and b (in Stata 9.2/SE it goes like
> this: g A=invibeta(a,b,uniform()) for binary variables.
This will create a random variable from a continuous
distribution (the beta distribution) whose values are bound
between 0 and 1. To create a binary variable you can type:
-gen A = runiform() < .5-. For more on this see:
Maarten L. Buis (2007) Stata tip 48: Discrete uses for
uniform(). The Stata Journal, 7(3):434--435.
http://www.stata-journal.com/article.html?article=pr0032
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* 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/