hbootindex | R Documentation |
Generates hierarchical bootstrap indices.
hbootindex(groups, strata, B = 199)
groups |
group membership vector. |
strata |
strata, optional. |
B |
number of bootstrap iterations. |
Resampling with replacement with weights proportional to the number of
observations in each of the group level (unique values in groups
).
Values of groups
within levels (unique values) of strata
are resampled independently of other strata
levels.
A matrix with bootstrapped indices, number of columns is B
+ 1.
The column is a resample without
replacement (random subsets can be selected without further
reshuffling). Other elements contain indices according to rules
described in Details section (these also randomly reshuffled).
Peter Solymos
## equal group sizes
groups <- rep(1:4, each=5)
strata <- rep(1:2, each=10)
hbootindex(groups, strata, 3)
## unequal group sizes
groups <- groups[-c(5,9,10,11)]
strata <- strata[-c(5,9,10,11)]
hbootindex(groups, strata, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.