Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Re: Bootstrapping with unbalanced panel
From
Heath Henderson <[email protected]>
To
[email protected]
Subject
st: Re: Bootstrapping with unbalanced panel
Date
Mon, 5 Aug 2013 09:54:16 -0400
Hello everybody,
In a previous exchange "bootstrapping with unbalanced panel" a method for
preserving the structure of unbalanced panel data while bootstrapping was
discussed. The idea is to cluster by the firm/household/individual
identifier variable and stratify by a variable that counts the number of
times a given entity is observed. Here is an example of that approach:
webuse union.dta
bysort idcode (year): gen byte panelsize = _N
bsample, cluster(idcode) idcluster(newid) strata(panelsize)
The approach is conceptually straightforward and after drawing the sample
we would expect newid and the time variable to uniquely identify
observations. This, however, doesn't seem to be the case as xtset yields
the following error:
. xtset newid year
repeated time values within panel
r(451);
What might be going on here? Why wouldn't newid and year uniquely identify
observations? If it matters, I am using STATA 12 SE for Mac. Any help would
be much appreciated. Thanks.
Heath Henderson
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/