Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bca

Bias-corrected and accelerated confidence intervals


Description

This function uses the method proposed by DiCiccio and Efron (1996) to generate confidence intervals that produce more accurate coverage rates when the distribution of bootstrap draws is non-normal. This code is adapted from the BC.CI() function within the mediate function in the mediation package.

Usage

bca(theta, conf.level = 0.95)

Arguments

theta

a vector that contains draws of a quantity of interest using bootstrap samples. The length of theta is equal to the number of iterations in the previously-run bootstrap simulation.

conf.level

the level of the desired confidence interval, as a proportion. Defaults to .95 which returns the 95 percent confidence interval.

Details

BC_a confidence intervals are typically calculated using influence statistics from jackknife simulations. For our purposes, however, running jackknife simulation in addition to ordinary bootstrapping is too computationally expensive. This function follows the procedure outlined by DiCiccio and Efron (1996, p. 201) to calculate the bias-correction and acceleration parameters using only the draws from ordinary bootstrapping.

Value

returns a vector of length 2 in which the first element is the lower bound and the second element is the upper bound

Author(s)

Jonathan Kropko <jkropko@virginia.edu> and Jeffrey J. Harden <jharden@nd.edu>, based on the code for the mediate function in the mediation package by Dustin Tingley, Teppei Yamamoto, Kentaro Hirose, Luke Keele, and Kosuke Imai.

References

DiCiccio, T. J. and B. Efron. (1996). Bootstrap Confidence Intervals. Statistical Science. 11(3): 189–212. https://doi.org/10.1214/ss/1032280214

See Also

Examples

theta <- rnorm(1000, mean=3, sd=4)
bca(theta, conf.level = .95)

coxed

Duration-Based Quantities of Interest for the Cox Proportional Hazards Model

v0.3.3
GPL-2
Authors
Kropko, Jonathan [aut, cre], Harden, Jeffrey J. [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.