# NOT RUN {
if(requireNamespace("lfe")){
library(fwildclusterboot)
library(lfe)
data(voters)
felm_fit <- felm(proposition_vote ~ treatment + ideology1 + log_income
| Q1_immigration,
data = voters)
boot1 <- boottest(felm_fit,
B = 9999,
param = "treatment",
clustid = "group_id1")
boot2 <- boottest(felm_fit,
B = 9999,
param = "treatment",
clustid = c("group_id1", "group_id2"))
boot3 <- boottest(felm_fit,
B = 9999,
param = "treatment",
clustid = c("group_id1", "group_id2"),
fe = "Q1_immigration")
boot4 <- boottest(felm_fit,
B = 999,
param = "treatment",
clustid = c("group_id1", "group_id2"),
fe = "Q1_immigration",
sign_level = 0.2,
seed = 8,
beta0 = 2)
summary(boot1)
plot(boot1)
}
# }
Run the code above in your browser using DataLab