Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Logit and the Clustered Bootstrap


From   L S <[email protected]>
To   [email protected]
Subject   Re: st: Logit and the Clustered Bootstrap
Date   Thu, 27 Aug 2009 18:04:19 -0700

Thanks for the very quick response, and for the link.

I understand for a bootstrapped cluster that STATA resamples the
clusters, i.e. states or census divisions.  The posted link discusses
this issue, as well as giving an example for xtreg.  The data I am
looking is cross-sectional (individuals in different states), so I'm
not sure that xtreg is what I'm looking for (though I realize that the
intent of the link was probably to explain bootstrap clustering in
general, not to deal with xtreg).

More crucially, I am still a bit puzzled specifically for logit.  Why
is it, that when STATA subsamples clusters that logit fails to run?
It is especially peculiar given that it seems to run okay when xtlogit
is used with fixed effects, but not when simply logit is run manually
including fixed effects:

A. bootstrap, cluster(division) idcluster(newid) reps(50) seed(1234)
: xtlogit odd tempjan, i(newid) fe
B. bootstrap, cluster(division) idcluster(newid) reps(50) seed(1234)
: logit odd tempjan  z2-z9

That is, Line A runs fine, but line B does not.  The analogous code using reg

bootstrap, cluster(division) idcluster(newid) reps(50) seed(1234): reg
odd tempjan z2-z9

runs fine, but not the one for logit.

A final point: I have read the bootstrap help file, the relevant
section of Cameron/Trivedi Microeconometrics for STATA, and the posted
link in the last email that discuss the option idcluster().  Just to
be sure I'm understanding what it's doing: Is idcluster creating
cluster fixed effects?  Cluster fixed effects will presumably depend
on which clusters are inlcuded in the subsample.  If this is correct,
it seems somewhat strange to me that I get the same results whether I
put i(division) or i(newid) in the last part of the command for xtreg.


On Thu, Aug 27, 2009 at 3:15 PM, Austin Nichols<[email protected]> wrote:
> See e.g.
> http://www.stata.com/statalist/archive/2006-11/msg00025.html
> but note you cannot expect reasonable estimates resampling from a
> sample of 9 (census divisions).
>
> On Thu, Aug 27, 2009 at 5:53 PM, L S<[email protected]> wrote:
>> Hello,
>>
>> I am trying to perform a clustered bootstrap in which I also include
>> fixed effects for the variable serving as the cluster identifier.  For
>> cross-sectional data on individuals in different states, I would like
>> to do a bootstrap that clusters by state, but also includes state
>> fixed effects.
>>
>> A difficulty with doing this is that this often doesn’t seem to work
>> with logit.  Here is some code that illustrates the point:
>>
>> clear
>> set more off
>> sysuse citytemp
>>
>> forvalues i = 2/9{
>>        gen z`i'=(division==`i')
>> }
>>
>> gen round_heatdd = round(heatdd)
>>
>> gen odd = mod(round_heatdd,2)
>> drop if odd==.
>>
>> reg odd tempjan z2-z9, cluster(division)
>> logit odd tempjan z2-z9, cluster(division)
>> bootstrap, cluster(division) reps(200) seed(1234): reg odd tempjan z2-z9
>> bootstrap, cluster(division) reps(200) seed(1234): logit odd tempjan z2-z9
>>
>> Reg and Logit each run fine with clustered standard errors in
>> non-bootstrapped form, as does the Reg bootstrap.  For the logit
>> bootstrap, the following error arises:
>>
>> “insufficient observations to compute bootstrap standard errors
>> no results will be saved”
>>
>> In other examples with logit and cluster-level fixed effects, STATA
>> will actually run through completely, but with the bootstrap working
>> on a small number of replications (instead of on zero).  For example,
>> if one includes only some of the fixed effects, this will occur:
>>
>> bootstrap, cluster(division) reps(200) seed(1234): logit odd tempjan z2-z5
>>
>> Does anyone know what is causing the bootstrap to fail to run normally
>> here?  Is there anything I can do so that the logit with a clustered
>> bootstrap will run?
>>
>> 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/
>

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index