Thanks!
Will it be the same by the following syntax?
sort hhid
by hhid:sample 1, count
A. C. Chen
2007/4/10, n j cox <[email protected]>:
set seed 12345
gen random = uniform()
bysort hhid (random) : gen byte select = _n == 1
Ada C. Chen
Could anyone suggest me how to use STATA to randomly select one person
within a household? (says, there may be one to many persons within the
same household) I have a dataset of individuals and each has a
household ID.
*
* 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/
*
* 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/