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 command when used with cluster and strata options


From   "Chris Frost" <Chris.Frost@lshtm.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Bootstrap command when used with cluster and strata options
Date   Wed, 23 Oct 2013 17:30:39 +0100

Dear Austin
 
Thanks for your reply - but I do think the problem is with the program, not with the data. In my data clusters (id) do not cross strata (group) - the problem is that in each bootstrap sample that is created the created cluster variable (newid) DOES (erroneously) cross strata. This can be seen if the bootstrap is run with the "noisily" option. If you are interested in seeing the behavior I can send you an annotated do file that illustrates the problem?
 
Chris

>>> Austin Nichols <austinnichols@gmail.com> 23/10/2013 16:42 >>>
Chris Frost <Chris.Frost@lshtm.ac.uk>:
Sounds like a problem with your data to me, not the program. If your
clusters seem to cross strata, because of the coding in your data, you
can define a new cluster variable
egen newc=group(group id)
or you can specify that clusters are defined by two variables
bootstrap, strata(group) cluster(group id) idcluster(newid):

On Wed, Oct 23, 2013 at 6:11 AM, Chris Frost <Chris.Frost@lshtm.ac.uk> wrote:
> I think that there is a problem with the bootstrap command when used in conjunction with the "cluster" and "strata" options. The problem arises because the command "bootstrap, strata(group) cluster(id) idcluster(newid) ....." creates a variable "newid" which is only unique (at the cluster level) within each strata. For example if there are 1000 subjects (with multiple measures per subject) each with a unique id but in two equal size groups the above command will result in each bootstrap sample having only 500 values of newid with subjects being erroneously paired up: this will lead to incorrect variance estimates with a command such as bootstrap, strata(group) cluster(id) idcluster(newid): mixed outcome i.group || newid:
>
> Am I correct? Can this be fixed?
>
> Chris Frost

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