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: Random Sample Selection in Panel Data


From   Dennis Kramer <dkramerii@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Random Sample Selection in Panel Data
Date   Fri, 13 May 2011 09:29:59 -0400

I have a large panel data sets (4 years-- 250,000 + records per year)
and I want to generate four random sample groups to test the stability
of the estimates. However, I want to ensure that if a ID is selected
in Year 1 then are are subsequently selected into the sample random
sample for Years 2, 3, and 4.

I know for a cross-sectional random sampling the code is as follows:

generate rannum = uniform()
egen grp2 = cut(rannum), group(4)

Does anyone have any insight into modifying the above syntax to
automatically include years2, 3, 4, ids in the same sample as the
selected Year 1 ID??

Thank you
*
*   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