Learn R Programming

Qindex (version 0.1.6)

bootid: Bootstrap Indices

Description

Generate a series of bootstrap indices.

Usage

bootid(n, R)

Value

Function bootid returns a length-\(R\)

list of positive integer

vectors. Each element is the length-\(n\) indices of each bootstrap sample.

Arguments

n

positive integer scalar, sample size \(n\)

R

positive integer scalar, number of bootstrap replicates \(R\)

Details

Function bootid generates the same bootstrap indices as those generated from the default options of function boot (i.e., sim = 'ordinary' and m = 0), given the same Random seed.

See Also

boot:::index.array and boot:::ordinary.array.

Examples

Run this code
set.seed(1345); boot::boot(data = 1:10, statistic = function(data, ind) ind, R = 3L)[['t']]
set.seed(1345); bootid(10L, R = 3L) # same copies of indices

Run the code above in your browser using DataLab