|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: randomly select individual within strata
From
n j cox <[email protected]>
To
[email protected]
Subject
Re: st: randomly select individual within strata
Date
Tue, 10 Apr 2007 14:14:56 +0100
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/
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |