s3alfisc / fwildclusterboot

Fast Wild Cluster Bootstrap Inference for Regression Models / OLS in R. Additionally, R port to WildBootTests.jl via the JuliaConnectoR.
https://s3alfisc.github.io/fwildclusterboot/
GNU General Public License v3.0
24 stars 4 forks source link

Problems with fixest::feols and endogenous covariates (wild cluster bootstrap for IV estimation) #156

Open LuisNavarro07 opened 1 month ago

LuisNavarro07 commented 1 month ago

Hello, I am trying to use the wild cluster bootstrap for a two stage least squares estimation absorbing for fixed effects.

I believe the problem is at line 86 of the boottest function when the function preprocess2.fixest gets the content from the fixest object with the estimation results. It works for standard feols estimation but not for the one two stage least squares.

This is snippet of the code I am running

Code

data(voters)

Error

Error in preprocess2.fixest(object = object, clustid = clustid, R = R_long, : object 'X' not found

I think the error is probably caused by the differences on the objects created by feols for the classic fixed effects implementation vs the two stages least squares estimation.