You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See this reproducible code:
It works without a function, but when used inside a function it says it cannot find data_obj.
When I define data_obj in the global directory, it works fine.
In principle, this should be solved by the new fixest option data.save. However, this still needs to be implemented in boottest, it seems. The following code still throws an error: Error in eval(call("model.frame", ff, data = cl$data, subset = cl$subset, : object 'DATA_SAVED' not found
See this reproducible code:
It works without a function, but when used inside a function it says it cannot find data_obj.
When I define data_obj in the global directory, it works fine.
requireNamespace("fwildclusterboot")
data(voters)
feols_fit <- feols(proposition_vote ~ treatment + ideology1 + log_income | Q1_immigration, data = voters)
boot1 <- boottest(feols_fit, B = 9999, param = "treatment", clustid = "group_id1")
summary(boot1)
boot_func <- function(data_obj) {
feols_fit1 <- feols(proposition_vote ~ treatment + ideology1 + log_income | Q1_immigration, data = data_obj)
boot1 <- boottest(feols_fit1,
B = 9999,
param = "treatment",
clustid = "group_id1")
return(summary(boot1))
}
boot_func(voters)
data_obj <- voters
boot_func(voters)
The text was updated successfully, but these errors were encountered: