Announcement

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

  • xtivreg, using bootstrapped standard errors by cluster

    I'm trying to run some panel data, and the way the sampling occurred I should bootstrap the standard errors with resampling by cluster (as described in Harden 2011). I've done this successfully with xtreg (fixed effects) but I'm trying to incorporate instrumental variables and I'm getting some error messages.

    The data I have is protected, but I can simulate the problem with the nlswork dataset.

    Code:
    cls
    
    webuse nlswork, clear
    
    keep if year==77 | year==78
    
    gen sampleclustervar=1 if idcode<2696
    replace sampleclustervar=2 if idcode>2696 & idcode<6000
    
    xtset id year
    xtreg ln_wage age tenure hours union, fe vce(bootstrap, reps(1000))  cluster(sampleclustervar) // This line works fine
    xtivreg ln_wage age tenure hours (union= south), fe vce(bootstrap, reps(1000))  cluster(sampleclustervar) // This line does not work
    Instead, I get an error that says:

    Code:
    option cluster() not allowed
    an error occurred when bootstrap executed xtivreg
    I'm also open to xtivreg2, if need be.
Working...
X