I need to get the actual list of elements used to generate each resampled statistic. To keep things really easy, I generated 100 random numbers and wanted to get the mean of each sample using tsboot from the boot
package.
x <- rnorm(100)
y <- tsboot(x, mean, R=10, l=20, sim="fixed")
What I need is the 10 lists of 20 numbers generated by tsboot. I realize that there is probably an easier way to do this but the act开发者_运维技巧ual project will require substituting a function for the mean and playing around with the block size. I tried using tsbootstrap
but also couldn't get the right output. Any assistance would be greatly appreciated.
Try
boot.array(y)
which returns a matrix with R=10 rows containing the (ordered) indices of the selected values.
精彩评论