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]
Re: st: bootstrap with clustered data
From
Stas Kolenikov <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: bootstrap with clustered data
Date
Thu, 30 Jan 2014 16:40:22 -0600
Stata only needs the -newid- to identify the groups in passing to
-xtreg-, so it does not really matter how it is being numbered. Sure
enough, Stata does it the simplest way possible, and that is
consecutive from 1 to the total number of clusters. Trying to tweak
say the values from the original -idcode- runs the risk of gluing
clusters together, and consecutive numbers is a much safer option.
What matters is that all of the observations within the -newid-
cluster are exactly the same observations as in one, and only one, of
the original -idcode- clusters.
-- Stas Kolenikov, PhD, PStat (ASA, SSC)
-- Principal Survey Scientist, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name
On Thu, Jan 30, 2014 at 1:51 PM, Litovitz, Aviva <[email protected]> wrote:
> Statalist,
>
> I am using the -bootstrap- command with clustered data in Stata 10 and I want to make sure I understand the role of -idcluster()-.
>
> As a test of the -bootstrap- command, I am using an example I found in the archives (http://www.stata.com/statalist/archive/2006-11/msg00025.html):
>
> . webuse nlswork
> . bootstrap, seed(1234) cluster(idcode) idcluster(newid) : xtreg ln_w grade age*, i(newid) fe
>
> If I understand correctly, -cluster(idcode)- sets the cluster variable and -idcluster(newid)- generates a new value for "newid" each time a cluster is sampled by the bootstrap. Yet when I look at "newid" values after the bootstrap is complete, each cluster is numbered consecutively, as if there were no changes to "newid" during the bootstrap process. Because "idcode" has some missing values, "newid" does not generally match "idcode".
>
> Why do the values of "newid" not change in the dataset?
>
> Thanks for any help!
> Aviva
>
>
>
> __________________________________________________________________________
>
> This email message is for the sole use of the intended recipient(s) and
> may contain confidential information. Any unauthorized review, use,
> disclosure or distribution is prohibited. If you are not the intended
> recipient, please contact the sender by reply email and destroy all copies
> of the original message.
>
>
> *
> * 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/
*
* 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/