Dear Statalisters,
Suppose I have the following data set:
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
In this sense, I would like to generate a new variable, say var4, which
may take one out of the 5 values presented (with equal probabilities).
I could not think about an easy way to do that using Stata when I have
several observations and, in some cases, repeated observations as well.
Hence, I will be grateful for any help.
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/