Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Randomly picking observations based on a certain condition


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Randomly picking observations based on a certain condition
Date   Wed, 13 Apr 2011 20:49:26 +0100

This doesn't strike me as a precise specification. Would you be satisfied with the first random sample of 100 from the whole that includes observations from each quintile? 

Why sample any way? Why divide into quintiles? 

Nick 
n.j.cox@durham.ac.uk 

Nikhil Srivastava

I have a dataset at the household level which contains the expenditure
details of a sample of households. The dataset also records the number
of adults within each household. I have divided this dataset into 5
quintiles based on the level of expenditure. Now I need to randomly
select a set of observations within each quintile so that the sum of
the adults for those observations comes to 100. Could somebody please
help me in writing a code for this part?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index