myboot2: My bootstrap program

Description Usage Arguments Details Value Examples

View source: R/myboot2.R

Description

Runs a bootstrap simulation to create a confidence interval

Usage

1
myboot2(iter = 10000, x, fun = "mean", alpha = 0.05, cx = 1.5, ...)

Arguments

iter

the number of samples to take for a bootstrap simulation, default 10000

x

a vector containing the population

fun

a character string with the name of the function to be examined, default is "mean"

alpha

the parameter determining the confidence level of the interval to 1-alpha percent, default is 0.05

cx

a character expansion factor applied to the text added to the histogram

...

a series of parameters passed to the hist() call that generates the histogram

Details

Given a vector containing the population, creates iter random samples and runs a bootstrap to create a confidence interval of (1-alpha)

Value

ci, the confidence interval

x, the input population

fun, the function being examined

Examples

1
2
3
set.seed(20)
sam=rnorm(20,mean=10,sd=4)
myboot2(x = sam)

Nat-Geo/math4753 documentation built on April 16, 2020, 12:35 a.m.