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

Problems when regressing on only one covariate for new 'WCR' implementations #74

Open s3alfisc opened 1 year ago

s3alfisc commented 1 year ago

E.g. in classical A/B test settings without controls:

  data(voters)

  feols_fit <-
    fixest::feols(proposition_vote ~ 0 + treatment, data = voters)

  expect_no_error(
    boottest(
      feols_fit,
      param = "treatment",
      clustid = "group_id1", 
      B = 999, 
      bootstrap_type = "31"
    )
  )
# error in solve.default(tX1X1) 'a' is 0-dim 

What happens? X1 is equal to the full design matrix X minus the column k for which the hypothesis beta_k = 0 is tested. If X is only a vector, X1 is obviously not something one can compute on.

Related to #72

s3alfisc commented 1 year ago

This is only a problem for the 'new' bootstrap types.