bootstrap {mcStats}R Documentation

Boostrap

Description

Boostrap using given data and statistic

Usage

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

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

[Package mcStats version 0.1.2 Index]