Hello,
I am working on recoding a categorical variable (orig) with 10 values into a binary variable (origred) coded 0,1.
gen origred = .
replace origred = 0 if orig >=1 & orig <=5
replace origred = 1 if orig >5 & orig <=10
There are a number of missing values for the original variable orig.
Is there a way to have Stata randomly assign those missing values to either a 0 or a 1 in the new variable origred? I am completely stumped.
Thanks in advance!
Robert
*
* 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/