Learn R Programming

DiagTest3Grp (version 1.6)

bootSample: Draw a bootstrap sample from a given vector of data values

Description

Draw one bootstrap sample of a given vector of sample values

Usage

bootSample(x, seed0)

Arguments

x
a numeric vector, sample data.
seed0
a random seed for bootstrap sampling.

Value

Returns a numeric vector which is a bootstrap sample drawn randomly with replacement from and with the same vector length as the sample data x .

Examples

Run this code

##generate random data
x <- rnorm(100)

##draw a bootstrap sample
boot.x <- bootSample(100,seed0=12345)

Run the code above in your browser using DataLab