Statalist


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

Re: st: Logit and the Clustered Bootstrap


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: Logit and the Clustered Bootstrap
Date   Fri, 28 Aug 2009 17:23:56 -0500

L S <[email protected]> is -bootstrap- with -logit-, while clustering on a
state variable whose level-indicators are also in the list of independent
variables:

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

Austin Nichols <[email protected]> replied with the URL for an old
Statalist post that mentions -bootstrap-'s -idcluster()- option.

There is a fundamental reason why -bootstrap- cannot be used this way.

The clustered bootstrap samples the clusters randomly, so the fixed-effects
dummies are not identified in all draws.  Here is an example.  Suppose you
have 50 states, your first bootstrap sample might only include two versions of
the even numbered states, in which case none of the fixed effects for the odd
numbered states are identified.

In Stata 11, all the replication methods now check for indep vars that are
'omitted' because of collinearity (indicator variables that are all 0 will be
dropped because of collinearity), so the above examples of -bootstrap- will
behave consistently across all estimation commands.

--Jeff
[email protected]
*
*   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