bootstrap: Bootstrap

View source: R/bootstrap.R

bootstrapR Documentation

Bootstrap

Description

Simplified version of the boot function.

Usage

bootstrap(x, fun, nrep = 1000, conf.level = 0.95, ...)

Arguments

x

numeric vector.

fun

function to be used for computation (function(x,i) ...(x[i])).

nrep

number of replicates.

conf.level

confidence level for confidence interval.

...

additional arguments to boot. See help of this function.

Details

See help of the boot function for more explanations.

Value

method

the character string "Bootstrap"

data.name

a character string giving the name of the data.

estimate

the estimated original value

conf.level

confidence level for confidence interval.

rep

number of replicates.

conf.int

limits of the confidence interval.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

See Also

boot

Examples

# Confidence interval of a mean
samp <- sample(1:50,10,replace=TRUE)
bootstrap(samp,function(x,i) mean(x[i]))

# Confidence interval of the standard error of the mean
bootstrap(samp,function(x,i) sd(x[i])/sqrt(length(x[i])))

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.