Calculates bias-corrected confidence intervals.
bc( thetahatstar, thetahat, alpha = c(0.001, 0.01, 0.05), wald = FALSE, null = 0, dist = "z", df, eval = FALSE, theta = 0 )
thetahatstar | Numeric vector.
The bootstrap sampling distribution
\(\left( \boldsymbol{\hat{\theta}^{*}} \right)\),
that is,
the sampling distribution of |
---|---|
thetahat | Numeric. Parameter estimate \(\left( \hat{\theta} \right)\) from the original sample data. |
alpha | Numeric vector.
Significance level
\(\left( \alpha \right)\) .
By default,
|
wald | Logical.
If |
null | Numeric.
Hypothesized value of |
dist | Character string.
|
df | Numeric.
Degrees of freedom (df) if |
eval | Logical.
Evaluate confidence intervals using
|
theta | Numeric. Population parameter \( \left( \theta \right) \). |
Returns a vector with the following elements:
Square root of Wald test statistic. NA
if wald = FALSE
.
p-value. NA
if wald = FALSE
.
Estimated bootstrap standard error \(\left( \widehat{\mathrm{se}}_{\mathrm{B}} \left( \hat{\theta} \right) \right)\).
Estimated bias-corrected confidence limits corresponding to alpha from the bootstrap sampling distribution thetahatstar \(\left( \boldsymbol{\hat{\theta}^{*}} \right)\).
If eval = TRUE
,
appends the following to the results vector
Logical. Tests if confidence interval contains zero.
Logical. Tests if confidence interval contains theta.
Length of confidence interval.
Shape of confidence interval.
The estimated bootstrap standard error is given by $$ \widehat{\mathrm{se}}_{\mathrm{B}} \left( \hat{\theta} \right) = \sqrt{ \frac{1}{B - 1} \sum_{b = 1}^{B} \left[ \hat{\theta}^{*} \left( b \right) - \hat{\theta}^{*} \left( \cdot \right) \right]^2 } $$ where $$ \hat{\theta}^{*} \left( \cdot \right) = \frac{1}{B} \sum_{b = 1}^{B} \hat{\theta}^{*} \left( b \right) . $$
Bias-correction \(\hat{z}_{0}\) has to be computed first and used to adjust the percentile ranks used in generating confidence intervals.
The bias-correction \(\hat{z}_{0}\) is given by
$$ \hat{z}_{0} = \Phi^{-1} \left( \frac{ \# \left\{ {\hat{\theta}}^{*} \left( b \right) < \hat{\theta} \right\} } { B } \right) $$
where
the quantity inside the parenthesis
is the proportion of bootstrap replications
less than the original parameter estimate \(\hat{\theta}\)
and
\(
\Phi^{-1}
\left(
\cdot
\right)
\)
is the inverse function
of a standard normal cumulative distribution function
(qnorm()
).
\(\hat{z}_{0}\) can then be used to obtain adjusted \(z\)-scores for the lower limit and the upper limit of the confidence interval as follows
$$ z_{ \mathrm{BC}_{ \mathrm{lo} } } = 2 \hat{z_0} + z_{ \left( \frac{\alpha}{2} \right) } , $$
$$ z_{ \mathrm{BC}_{ \mathrm{up} } } = 2 \hat{z_0} + z_{ \left( 1 - \frac{\alpha}{2} \right) } . $$
The adjusted \(z\)-scores are used to determine the adjusted percentile ranks to form the confidence interval.
The bias-corrected confidence interval is given by $$ \left[ \hat{\theta}_{\mathrm{lo}}, \hat{\theta}_{\mathrm{up}} \right] = \left[ \hat{\theta}^{*}_{ \left( z_{ \mathrm{BC}_{ \mathrm{lo} } } \right) }, \hat{\theta}^{*}_{ \left( z_{ \mathrm{BC}_{ \mathrm{up} } } \right) } \right] . $$
For more details and examples see the following vignettes:
Notes: Introduction to Nonparametric Bootstrapping
Notes: Introduction to Parametric Bootstrapping
Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York, N.Y: Chapman & Hall.