a function with argument data and ii, that calculates
a statistic of interest for data[ii] or
data[ii, , drop=FALSE], for a vector or matrix, respectively.
old value of .Random.seed, or argument to set.seed.
statisticNames
a character vector the same length as the vector returned by
statistic, giving names.
block.size
integer. The B replicates are done this many at a time.
trace
logical, if TRUE an indication of progress is printed.
...
addition arguments passed to sampler.
observedIndices
integer vector of indices, used for calculating the observed value.
When this is called by bootstrap2 or
permutationTest2, those should b
Value
an object of class "resample"; this is
a list with components:
observedthe observed statistic, length p.
replicatesa matrix with B rows and p columns.
nnumber of observations
pthe length of the statistic returned by resampleFun.
Bnumber of resamples.
seedthe value of seed when this function is called.
Details
This is called by
bootstrap,
bootstrap2,
permutationTest, and
permutationTest2 to actually perform resampling.
The results are passed back to the calling function, which may
add additional components and a class, which inherits from
"resample".
This may also be called directly. In contrast to the other functions,
where you have flexibility in how you specify the statistic, here
resampleFun must be a function.