-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Labels
Description
Feature Request: Make it Possible to Create a Data Frame of Bootstrapped AME Replicates
The bootstrap AME function provides sample statistics for the for the resulting AME estimates but it would be helpful to be able to save the AME estimates as a data frame so that the distribution of the AMEs could be plotted directly and compared to other samples. In the data frame that I am imagining, there would be a column that indicates the bootstrap/sample id, and the relevant AME information from each draw. In theory, it should also be fairly easy to use the percentile method to calculate confidence interval once all of the bootstrapped samples have been stored in a data frame.
#--------- Boot AME Sample Data
boot_dta <- data.frame(
boot_id = seq(1, 10, 1),
term = 1,
sim_ame = rnorm(boot_id, 2, .05)
)
#---- Percentile Method
library(dplyr)
alpha <- .05
boot_dta %>%
group_by(term) %>%
summarize(low = quantile(sim_ame, alpha / 2),
high = quantile(sim_ame, 1 - alpha / 2))