This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create_bootstrap <- function (.data, num_samples, sample_size) { | |
# Create "num_samples" samples, of size "sample_size", from the original population ".data" | |
samples <- rerun(num_samples, sample(.data, sample_size, replace = TRUE)) | |
# Find the standard deviation of each dataset | |
std_devs <- samples %>% map_dbl(sd) | |
# Find the bounds of the 95% confidence interval | |
interval <- std_devs %>% quantile(c(.025, .975)) | |