Skip to contents

Computes a percentile-based confidence interval for a summary statistic, based on a vector of bootstrap or permutation replicates.

Usage

computePercentileCI(rnd, conf.level = 0.95, na.rm = FALSE)

Arguments

rnd

a numeric vector containing the bootstrap or permutation replications of the summary statistic.

conf.level

a numeric scalar between 0 and 1 specifying the desired confidence level. Defaults to 0.95.

na.rm

logical. Should missing values be removed before computing quantiles? Defaults to FALSE.

Value

A named numeric vector with two elements: lower and upper, corresponding to the lower and upper bounds of the percentile confidence interval.

Details

The percentile confidence interval is defined by taking the \(\alpha/2\) and \(1 - \alpha/2\) quantiles of the bootstrap distribution, where \(\alpha = 1 - \text{conf.level}\).

This method does not rely on the symmetry or normality of the sampling distribution and is often used in bootstrap analysis.

References

Efron, B. and Tibshirani, R.J. (1994). An Introduction to the Bootstrap. CRC Press.

See also

computeStandardCI for standard normal/t-based intervals.

Author

Alessandro Barberis