powered by
Compute a bootstrap distribution for the sample mean.
bs_mean(x, R = 2000, conf = 0.95)
A list with elements stat (mean), boot (replicates), and ci (interval).
numeric vector of data.
integer number of bootstrap replicates (default 2000).
numeric confidence level between 0 and 1 (default 0.95).
set.seed(42) x <- rnorm(50, mean = 5, sd = 2) result <- bs_mean(x, R = 500) result$ci
Run the code above in your browser using DataLab