Skip to content

Feature Request: Data frame of Bootstrap Replicates  #106

@gl-smith

Description

@gl-smith

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))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions