bcpCI: Bias-Corrected Percentile Confidence Interval

Description Usage Arguments Value References Examples

View source: R/bcpCI.R

Description

Calculates the bias-corrected percentile confidence interval from a bootstrap sample.

Usage

1
bcpCI(tboot, orig, alpha = 0.05)

Arguments

tboot

A numeric vector of bootstrap estimates, typically $t from the output of the boot function.

orig

A numeric scalar, the original estimate from the data, typically $t0 from the output of the boot function.

alpha

A numeric scalar, the desired significance level for 100*(1-alpha)% confidence limits, default 0.05.

Value

A named numeric vector of length 2, with the lower and upper confidence limits.

References

Manly, Bryan F. J. 1997. Randomization, Bootstrap and Monte Carlo Methods in Biology. Chapman & Hall, London.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bcpCI(exp(rnorm(20)), 1)

## Not run: 
# Bootstrap of the ratio of means using the city data
library(boot)
ratio <- function(d, w) sum(d$x * w)/sum(d$u * w)
results <- boot(city, ratio, R=999, stype="w")
results$t0
bcpCI(results$t, results$t0, 0.1)

## End(Not run)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.