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
22 stars 4 forks source link

`boottest()` thows no error for fixest models with varying slopes fixed effects #126

Closed s3alfisc closed 1 year ago

s3alfisc commented 1 year ago

E.g. for models as

feols(Y ~X | var1[var2])

boottest does not throw an error when no cluster variable is specified.

Instead, it continues to control for ~var1 + var2 as fixed effects.

If a cluster variable is specified, the following error pops up:

library(fixest)
library(fwildclusterboot)
packageVersion("fwildclusterboot")

base = iris
names(base) = c("y", paste0("x", 1:3), "fe1")
# Create another "fixed-effect"
base$fe2 = rep(letters[1:5], 30)
head(base)

est_vs = feols(y ~ x1 | fe2[[x2]], base, cluster = "fe1")
# Error in fe2[[x2]] : 
#   attempt to select more than one element in vectorIndex

Hence not as critical as I had feared - only the heteroskedastic bootstrap is affected - but still not great.