Statalist


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

Re: R: st: Bootstrapping new observations to add to an existing dataset


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: R: st: Bootstrapping new observations to add to an existing dataset
Date   Mon, 22 Jun 2009 15:50:36 +0000 (GMT)

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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index