Closed jcha1997 closed 1 year ago
Hi @jcha1997 - that's definitely not good. Sorry for the inconvenience! I hope that I will find time later today to look at this in more detail.
Some things that might help me debugging:
boottest()
run when you drop the fixed effect, i.e. set fe = NULL
? It looks like the error is related to the algo implemented in the boot_algo3
function, which implements the WCR-C / WCR11 following Roodman et al's algo.boottest()
run when you change the bootstrap algo to bootstrap_type = 11
or bootstrap_type = 31
? I took a quick look at tests that I am running, they seem to behave fine (though I am running version 0.12.3 locally):
library(fwildclusterboot)
library(fixest)
df <-
fwildclusterboot:::create_data(
N = 1000,
N_G1 = 20,
N_G2 = 20,
icc1 = 0.5,
icc2 = 0.5,
numb_fe1 = 10,
numb_fe2 = 10,
seed = 3
)
fit <- feols(
proposition_vote ~ treatment + income | Q1_immigration + Q2_defense,
cluster = ~group_id1,
data = df
)
wcb1 <- boottest(fit, param = ~treatment, clustid = ~group_id1, B = 999, seed = 12)
wcb2 <- boottest(fit, param = ~treatment, clustid = ~group_id1, B = 999, fe = "Q1_immigration", seed = 12)
tidy(wcb1)
# term estimate statistic p.value
# 1 1*treatment = 0 -0.008866375 -0.6477245 0.5355355
# conf.low conf.high
# 1 -0.0382505 0.01952578
tidy(wcb2)
# term estimate statistic p.value
# 1 1*treatment = 0 -0.008866375 -0.6477245 0.5355355
# conf.low conf.high
# 1 -0.0382505 0.01952578
Maybe you can reproduce the error with an example data set, if you find the time? Anyways, I promise to look at this as soon as I can!
Best, Alex
Ah! I apologize - I made an error in the specification of the variable. I'll close the issue.
No worries - I'm always happy to hear from people who use fwildclusterboot =) And great that it wasn't a bug after all! Was the variable not included in the fixest model? I thought I had error handling implemented for that - maybe something to improve?
I had misspecified the parameter, which makes sense that I was receiving a singularity error! There was no treatment! Again, appreciate the quick help.
Thanks for the feedback - good to hear that boottest() isn't producing output when it shouldn't!
Great to see the package back on CRAN!
I attempted to run some code that worked in an earlier version, but am running into a matrix solution error:
Error in solve.default(R %*% A %*% t(R)) : Lapack routine dgesv: system is exactly singular: U[1,1] = 0
A toy example of my code is: