plot_ci: Plots a bootstrapped sampling distribution with its...

View source: R/plot_ci.R

plot_ciR Documentation

Plots a bootstrapped sampling distribution with its confidence interval and observed mean.

Description

A bootstrapped confidence interval for the desired estimator for the provided sample is calculated for a confidence level level.

Usage

plot_ci(
  sample,
  rep,
  bin_size = 30,
  n = "auto",
  level = 0.95,
  seed = NULL,
  title = "",
  y_axis = "Count",
  estimator = "mean",
  path = NULL
)

Arguments

sample

A numeric vector to bootstrap

rep

A integer vector for number of replicates

bin_size

A integer vector for number of bins representing intervals of equal size over the range

n

A integer or character vector for the size of bootstrap samples

level

A numeric vector for the confidence level

seed

A integer vector as seed.

title

A character vector for the title of the histogram

y_axis

A character vector for the name of the y axis

estimator

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

path

A character vector for the path to directory from current directory to save plot

Details

Other stats and parameters of the distribution and sample are also returned.

Value

ggplot object

Examples

plot_ci(c(1, 2, 3, 4, 5, 6, 7), 1000, n = 100, level = 0.95)
plot_ci(c(1, 2, 3, 4, 5, 6, 7), 1000, n = 100, path = "../")

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