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
)

Arguments

thetahatstar

Numeric vector. The bootstrap sampling distribution \(\left( \boldsymbol{\hat{\theta}^{*}} \right)\), that is, the sampling distribution of thetahat estimated for each b bootstrap sample. \( \hat{\theta}_{\left( 1 \right)}, \hat{\theta}_{\left( 2 \right)}, \hat{\theta}_{\left( 3 \right)}, \hat{\theta}_{\left( b \right)}, \dots, \hat{\theta}_{\left( B \right)} \) .

thetahat

Numeric. Parameter estimate \(\left( \hat{\theta} \right)\) from the original sample data.

alpha

Numeric vector. Significance level \(\left( \alpha \right)\) . By default, alpha is set to conventional significance levels alpha = c(0.001, 0.01, 0.05).

wald

Logical. If TRUE, calculates the square root of the Wald test statistic and p-value. The estimated bootstrap standard error is used. The arguments null, dist, and df are used to calculate the square root of the Wald test statistic and p-value and are NOT used in constructing the bootstrap confidence interval. If FALSE, returns statistic = NA and p = NA If FALSE, the arguments null, dist, and df are ignored.

null

Numeric. Hypothesized value of theta \(\left( \theta_{0} \right)\). Set to zero by default.

dist

Character string. dist = "z" for the standard normal distribution. dist = "t" for the t distribution.

df

Numeric. Degrees of freedom (df) if dist = "t". Ignored if dist = "z".

eval

Logical. Evaluate confidence intervals using zero_hit(), theta_hit(), len(), and shape().

theta

Numeric. Population parameter \( \left( \theta \right) \).

Value

Returns a vector with the following elements:

statistic

Square root of Wald test statistic. NA if wald = FALSE.

p

p-value. NA if wald = FALSE.

se

Estimated bootstrap standard error \(\left( \widehat{\mathrm{se}}_{\mathrm{B}} \left( \hat{\theta} \right) \right)\).

ci_

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

zero_hit_

Logical. Tests if confidence interval contains zero.

theta_hit_

Logical. Tests if confidence interval contains theta.

length_

Length of confidence interval.

shape_

Shape of confidence interval.

Details

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

References

Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. New York, N.Y: Chapman & Hall.

See also

Other bootstrap confidence interval functions: .bca(), bca(), pc()