Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • block bootstrap (cluster-robust bootstrap) with xtpoisson

    Hi,

    I have panel count data with an endogenous variable and use a first stage residual inclusion control function (cf) to overcome that.
    To get correct inference I need to bootstrap the standard errors.

    Is it possible to do this with clusters?

    bootstrap, reps(1000) cluster(id): xtpoisson y x cf, fe i(id)

    doesnt' work.

    Would

    bootstrap, reps(1000): xtpoisson y x cf, fe i(id) r

    do the job?

    Many thanks,

    Bobby

  • #2
    Originally posted by Bobby Wood View Post
    bootstrap, reps(1000) cluster(id): xtpoisson y x cf, fe i(id)

    doesnt' work.
    You might want to take a look at this for some advice on that.

    Would

    bootstrap, reps(1000): xtpoisson y x cf, fe i(id) r

    do the job?
    For xt commands, the cluster bootstrap is now built-in. Have you considered something like this?
    Code:
    xtset id
    xtpoisson y x cf, fe vce(bootstrap, reps(1000))
    On the other hand, if you need to include the "first stage residual inclusion control function" into the bootstrap procedure, then you would probably have to write a brief wrapper command that incorporates both the first-stage regression command and the Poisson follow-on regression so that the bootstrap sample is used for both. You can check the entry for bootstrap in Stata's set of user's manuals, but I believe that it would look (very roughly) like this:
    Code:
    program define bootem
        version 15.1
        syntax varname [if]
    
        marksample touse
    
        xtreg stuff1 i.stuff2 c.etc if `touse', i(`varlist') fe
        tempvar cf
        quietly predict double `cf', ue
    
        xtpoisson y x c.`cf' if `touse', i(`varlist') fe
    end
    
    bootstrap x = _b[x], reps(1000) cluster(id) idcluster(newid): bootem newid
    The suggestion obviously has not been tested; moreover, I'm no econometrician and so I'm guessing as to what your commands look like, but I believe that you can take it from there.

    You might want to take a look at gsem and see whether that estimation command can fit a model that addresses your research question more cleanly.

    Comment

    Working...
    X