bootid: Bootstrap Indices

View source: R/bootid.R

bootidR Documentation

Bootstrap Indices

Description

Generate a series of bootstrap indices.

Usage

bootid(n, R)

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).

Value

Function bootid returns a length-R list of positive integer vectors. Each element is the length-n indices of each bootstrap sample.

See Also

Function bootid is inspired by functions boot:::index.array and boot:::ordinary.array.

Examples

set.seed(1345); (bt1 = boot::boot(data = 1:10, statistic = function(data, ind) ind, R = 3L)[['t']])
set.seed(1345); (bt2 = do.call(rbind, bootid(10L, R = 3L)))
stopifnot(identical(bt1, bt2))

Qindex documentation built on April 4, 2025, 2:14 a.m.