hbootindex {detect}R Documentation

Hierarchical bootstrap indices

Description

Generates hierarchical bootstrap indices.

Usage

hbootindex(groups, strata, B = 199)

Arguments

groups

group membership vector.

strata

strata, optional.

B

number of bootstrap iterations.

Details

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.

Value

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

Author(s)

Peter Solymos

Examples

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

[Package detect version 0.4-4 Index]