hier.boot.mean: Bootstrap CI of the mean with hierarchical data

View source: R/hier.boot.mean.R

hier.boot.meanR Documentation

Bootstrap CI of the mean with hierarchical data

Description

This function applies a non-parametric bootstrapping procedure suited to hierarchically structured data, sometimes called a multi-stage bootstrap. A study where random sites are selected, then multiple sub-plots are surveyed at each site would be a hierarchical example. Here, resampling is done first at the top level, then at the sub-level measurements associated with that top level stratum. There is some debate about whether resampling at each level should be done with or without replacement. Here, we sample with replacement at both levels.

Usage

hier.boot.mean(x, strata, data, B = 500, ci = 0.95, plot = TRUE)

Arguments

x

Name of column (in quotes) containing numeric sub-level measurements.

strata

Name of column (in quotes) containing factors that identify top-level strata.

data

Data.frame containing the above columns.

B

Number of bootstrap replicates. Default is 500.

ci

Level of confidence interval (CI). Default is 95% CI.

plot

Logical, should a histogram of the bootstrap replicates and CI be plotted. Default is TRUE.

Value

A named numeric vector giving the observed mean and lower and upper confidence limits.

Author(s)

Jason D. Carlisle, University of Wyoming

See Also

boot.mean


jcarlis3/ecoinfo documentation built on Sept. 9, 2023, 1:46 p.m.