A function to compare the bootstrap sampling distribution with a normal distribution with mean and SEM estimated from the data

e_plot_bs_one_samp_dist(
  dat,
  N = 10000,
  sw_graphics = c("ggplot", "base")[1],
  sw_ggplot_print = c(TRUE, FALSE)[2],
  conf_level = 0.95
)

Arguments

dat

a list of values

N

number of bootstrap iterations

sw_graphics

use either ggplot or R base graphics

sw_ggplot_print

if ggplot, print the plot or just return the grob

conf_level

0.95 for a 95% bootstrap CI

Value

invisible(NULL) or ggplot grob

Examples

e_plot_bs_one_samp_dist(dat = runif(15), sw_graphics = "base")

e_plot_bs_one_samp_dist(dat = runif(15), sw_graphics = "ggplot")
#> Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
#>  Please use `after_stat(density)` instead.
#>  The deprecated feature was likely used in the erikmisc package.
#>   Please report the issue at <https://github.com/erikerhardt/erikmisc/issues>.