I need to conduct an analysis of variance ANOVA comparing a linear model obtained through a standard OLS regression and one with heteroscedasticity robust standard errors obtained through a bootstrap cluster method.
While conducting ANOVA on the coefficients obtained through OLS is straightforward with the anova(mymodel)
function, I cannot seem to find a way to do it on the bootstrap clustered coefficients obtained through the boottest
function of the fwildclusterboot
package. The following doesn't seem to work.
# "lm" is my linear model
lm_coefnames <- c("treatment", "var1", "var2", "Intercept")
set.seed(2020)
boot_lm <- matrix(NA, length(lm_coefnames), 4)
for (i in 1:length(lm_coefnames)){
boot_lm[i, ] <- as.numeric(summary(boottest(lm, clustid = "cluster_variable",
param = lm1_coefnames[i], B = 9999))[1, c(2,4:6)])
}
anova(summary(boot_lm))
Any ideas?