Bookmark and Share

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   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: bootstrap with clustered data
Date   Thu, 30 Jan 2014 18:19:01 -0500

Yes there is.  Use the saving()-option in the bootstrap command to save a dataset of the bootstrap replicates.

Steve
[email protected]


On Jan 30, 2014, at 6:08 PM, "Litovitz, Aviva" <[email protected]> wrote:

Thanks Stas.  I thought that if a cluster was selected more than once it would get a new newid.  It looks like there's no way of seeing that in the data?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stas Kolenikov
Sent: Thursday, January 30, 2014 2:40 PM
To: [email protected]
Subject: Re: st: bootstrap with clustered data

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/

__________________________________________________________________________

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index