basic: Construct Basic Bootstrap Intervals

View source: R/Functions.R

basicR Documentation

Construct Basic Bootstrap Intervals

Description

Implements the basic bootstrap method to construct interval estimates.

Usage

basic(sample, parameter, B = 999, siglevel = 0.05, onlyint = FALSE)

Arguments

sample

a vector of data which the user desires to bootstrap from

parameter

the name of a pre-defined (possibly user-written) function in quotes whose output is one value (e.g. mean, min, max, median)

B

number of bootstrap samples to obtain (defaults to 999 and must be less than 5000)

siglevel

the significance level desired for the construction of the bootstrap interval (defaults to 0.05)

onlyint

should the bootstrap interval alone be printed? (defaults to FALSE)

Value

If onlyint is set to FALSE, a histogram of the bootstrap sample statistics, with a line at the observed sample statistic, and the bootstrap interval are returned.

If onlyint is set to TRUE, only the bootstrap interval is returned as a numeric vector.

Author(s)

Njesa Totty

References

Davison, A. C., & Hinkley, D. V. (1997). Bootstrap Methods and Their Application (No. 1). Cambridge University Press.

Efron, B., & Tibshirani, R. J. (1994). An Introduction to The Bootstrap. CRC Press.

Examples

basic(sample = rnorm(100), parameter = "mean", B = 999, siglevel = 0.05)


tottyn/bootEd documentation built on Oct. 12, 2024, 7:47 a.m.