calculate_boot_stats: Calculates a bootstrapped confidence interval and other stats...

View source: R/calculate_boot_stats.R

calculate_boot_statsR Documentation

Calculates a bootstrapped confidence interval and other stats for a sample.

Description

A bootstrapped confidence interval for the desired estimator for the provided sample is calculated for a confidence level level. Other stats and parameters of the distribution and sample are also returned.

Usage

calculate_boot_stats(
  sample,
  rep,
  n = "auto",
  level = 0.95,
  estimator = "mean",
  seed = NULL,
  pass_dist = FALSE
)

Arguments

sample

A numeric vector to bootstrap

rep

A integer vector for number of replicates

n

A integer or character vector for the size of bootstrap samples

level

A numeric vector for the confidence level

estimator

A character vector containing one of the ("mean", "median", "var", "sd") estimators

seed

A integer vector as random seed. Can be NULL

pass_dist

A boolean vector to decide whether to return the bootstrapped distribution

Value

A named list

Examples

calculate_boot_stats(c(1, 2, 3, 4), 1000, level = 0.95, seed = 1)
calculate_boot_stats(c(1, 2, 3, 4), 1000, level = 0.95, estimator = "median",
seed = 1, pass_dist = TRUE)

UBC-MDS/strapvizr documentation built on March 22, 2022, 6:39 p.m.