e_plot_bs_two_samp_diff_dist: Visual comparison of whether Bootstrap sampling distribution...

View source: R/e_plot_bs_two_samp_diff_dist.R

e_plot_bs_two_samp_diff_distR Documentation

Visual comparison of whether Bootstrap sampling distribution of the difference in means is close to Normal

Description

A function to compare the bootstrap sampling distribution of the difference of means from two samples with a normal distribution with mean and SEM estimated from the data

Usage

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

Arguments

dat1

a list of values from Sample 1

dat2

a list of values from Sample 2

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)

Examples

e_plot_bs_two_samp_diff_dist(dat1 = runif(15), dat2 = runif(15) - 2, sw_graphics = "base")
e_plot_bs_two_samp_diff_dist(dat1 = runif(15), dat2 = runif(15) - 2, sw_graphics = "ggplot")

erikerhardt/erikmisc documentation built on April 17, 2025, 10:48 a.m.