I could not find a command that performs this simple task. I was hoping if
someone might have some advice. I have a variable named emp that looks
like this
emp Freq.
0 93,404
1 55,537
2 36,556
I want to replace emp=2 at random with 0 or 1 depending on the relative
number of 1s and 0s in the sample. My outcome should look like this
emp Freq.
0 116,329
1 69,168
Thank you in advance for your help.
Dimitriy Masterov
*
* 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/