Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: How to sample uniformly over a set of specific observations?


From   [email protected]
To   [email protected]
Subject   st: How to sample uniformly over a set of specific observations?
Date   Sun, 14 Oct 2007 18:42:52 -0300 (BRT)

Thank you, Svend.

I was not very clear, indeed.

Getting back to my hypothetical dataset:


var1 var2 var3
0.5 0.5 0.25
0.4 0.4 0.16
0.3 0.4 0.12
0.8 0.4 0.32
0.4 0.2 0.08

The objective is to generate a fourth variable, var4, that can take any
value of the variable 3, var3. Hence, the first observation of var4 can
take one out of 5 values of the var3 (0.32, 0.25, 0.16, 0.12, 0.08) [with
equal probabilities] and so on.





All the best,

Tiago






*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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