bootid | R Documentation |
Generate a series of bootstrap indices.
bootid(n, R)
n |
positive integer scalar, sample size |
R |
positive integer scalar, number of bootstrap replicates |
Function bootid generates the same bootstrap indices as
those generated from the default options of function boot
(i.e., sim = 'ordinary'
and m = 0
).
Function bootid returns a length-R
list of
positive integer vectors.
Each element is the length-n
indices of each bootstrap sample.
Function bootid is inspired by functions boot:::index.array
and boot:::ordinary.array
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.