-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Here is a reproducible example
set.seed(1234)
N <- 1000
x <- rnorm(N, 0, 10)
fe <- sample(letters, 100, replace = TRUE)
femu <- rnorm(N, seq_along(fe))
fesd <- rexp(N, seq_along(fe))
y <- 5 * x + femu + rnorm(N, fesd)
df <- data.frame(y, x, fe)
feols(y ~ x | fe, df, vcov = ~fe)
# 1. Fails
boottest(feols(y ~ x | fe, df), clustid = "fe", B = 9999, param = "x", fe = "fe")
# 2. Fails
boottest(feols(y ~ x | factor(fe), df), clustid = "fe", B = 9999, param = "x", fe = "fe")
# 3. Works
df$fe <- factor(df$fe)
boottest(feols(y ~ x | fe, df), clustid = "fe", B = 9999, param = "x", fe = "fe")Debugging 1. has lead me to this function as the culprit:
debug: suppressWarnings(expand.model.frame(model = manipulate_object(object),
extras = clustid_fml, na.expand = FALSE, envir = call_env))For 2. the error is here:
debug: if (!(fe %in% object$fixef_vars)) {
rlang::abort(paste("The fixed effect to be projected out in the bootstrap,",
fe, "is not included as a dedicated fixed effect\n in the estimated model."))
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working