bootstraps(mtcars, times = 2)
bootstraps(mtcars, times = 2, apparent = TRUE)
library(purrr)
library(modeldata)
data(wa_churn)
set.seed(13)
resample1 <- bootstraps(wa_churn, times = 3)
map_dbl(
resample1$splits,
function(x) {
dat <- as.data.frame(x)$churn
mean(dat == "Yes")
}
)
set.seed(13)
resample2 <- bootstraps(wa_churn, strata = churn, times = 3)
map_dbl(
resample2$splits,
function(x) {
dat <- as.data.frame(x)$churn
mean(dat == "Yes")
}
)
set.seed(13)
resample3 <- bootstraps(wa_churn, strata = tenure, breaks = 6, times = 3)
map_dbl(
resample3$splits,
function(x) {
dat <- as.data.frame(x)$churn
mean(dat == "Yes")
}
)
Run the code above in your browser using DataLab