View source: R/reg_bootstrap.R
reg_bootstrap | R Documentation |
Performs a regular bootstrap to generate a distribution of sample statistics and computes a set of summary statistics: mode, median, mean, standard deviation, and lower and upper confidence intervals.
reg_bootstrap(
data,
n_bootstraps = 10000,
anon = function(x) (mean(x)),
lb = 0.025,
ub = 0.975,
density_args
)
data |
A numeric vector of data points. |
n_bootstraps |
An integer indicating the number of bootstrap samples to generate. Default is 10000. |
anon |
A function to compute the sample statistic for each bootstrap sample. Default is the mean function. |
lb |
Lower bound for the confidence interval. Default is 0.025. |
ub |
Upper bound for the confidence interval. Default is 0.975. |
density_args |
Additional arguments to be passed to |
A list with two elements:
dens: a density estimate of the bootstrap sample statistics,
stats: a list of summary statistics including number of resamples, mode, median, mean, standard deviation, lower confidence interval (lCI), and upper confidence interval (uCI).
plot.regboot
, summary.regboot
set.seed(123)
data <- rnorm(5)
result <- reg_bootstrap(data)
result$stats
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.