bootstrap: Bootstraps a sampling distribution for a sample.

View source: R/bootstrap.R

bootstrapR Documentation

Bootstraps a sampling distribution for a sample.

Description

A sampling distribution of rep replicates is generated for the specified estimator with replacement with a bootstrap sample size of n.

Usage

bootstrap(sample, rep, n = "auto", estimator = mean, seed = NULL)

Arguments

sample

A numeric vector to bootstrap

rep

A numeric vector for number of replicates

n

A numeric or character vector for the size of bootstrap samples

estimator

A function that is one of mean, median, var, sd

seed

A numeric vector as random seed. Can be NULL

Value

A numeric vector for bootstrap distribution

Examples

bootstrap(c(1, 2, 3), 3, 3)
bootstrap(c(1, 2, 3), 3, 3, estimator = var, seed = 1)

UBC-MDS/strapvizr documentation built on March 22, 2022, 6:39 p.m.