bootstrap: Boostrap

Description Usage Arguments Value Examples

View source: R/Bootstrap.R

Description

Boostrap using given data and statistic

Usage

1
bootstrap(fun, data, h0, nreps, conf.level = 0.95, verbose = 1)

Arguments

fun

function to calculate on each sample. This can be a user-defined function that takes in data as a vector and returns a statistic.

data

data to use for bootstrapping. Should be a respresentative sample

h0

null hypothesis value

nreps

number of times to bootstrap

conf.level

confidence value

verbose

default is 1 which will create a graph. To turn this off use verbose = 0.

Value

results from boostrapping. A vector of length @param nreps containing each statistic calculated

Examples

1
2
3
x <- rnorm(100)
bootstrap(mean, x, 0.5, 1000, verbose = 0)
bootstrap(mean, x, 0.5, 1000)

mcStats documentation built on March 26, 2020, 7:37 p.m.