bca: Confidence Interval - Bias-Corrected and Accelerated

Description Usage Arguments Details Value Author(s) References See Also

View source: R/boot_ci.R

Description

Calculates bias-corrected and accelerated confidence intervals.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
bca(
  thetahatstar,
  thetahat,
  data,
  fitFUN,
  ...,
  alpha = c(0.001, 0.01, 0.05),
  wald = FALSE,
  null = 0,
  dist = "z",
  df,
  eval = FALSE,
  theta = 0,
  par = TRUE,
  ncores = NULL,
  mc = TRUE,
  lb = FALSE,
  cl_eval = FALSE,
  cl_export = FALSE,
  cl_expr,
  cl_vars
)

Arguments

thetahatstar

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

thetahat

Numeric. Parameter estimate ≤ft( \hat{θ} \right) from the original sample data.

data

Vector, matrix, or data frame. Sample data. Ignored if thetahatstarjack is provided.

fitFUN

Function. Fit function to use on data. The first argument should correspond to data. Other arguments can be passed to fitFUN using .... fitFUN should return a single value. Ignored if thetahatstarjack is provided.

...

Arguments to pass to fitFUN.

alpha

Numeric vector. Significance level ≤ft( α \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 ≤ft( θ_{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 ≤ft( θ \right) .

par

Logical. If TRUE, use multiple cores. If FALSE, use lapply().

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

mc

Logical. If TRUE, use parallel::mclapply(). If FALSE, use parallel::parLapply() or parallel::parLapplyLB(). Ignored if par = FALSE.

lb

Logical. If TRUE use parallel::parLapplyLB(). If FALSE, use parallel::parLapply(). Ignored if par = FALSE and mc = TRUE.

cl_eval

Logical. Execute parallel::clusterEvalQ() using cl_expr. Ignored if mc = TRUE.

cl_export

Logical. Execute parallel::clusterExport() using cl_vars. Ignored if mc = TRUE.

cl_expr

Expression. Expression passed to parallel::clusterEvalQ() Ignored if mc = TRUE.

cl_vars

Character vector. Names of objects to pass to parallel::clusterExport() Ignored if mc = TRUE.

Details

The estimated bootstrap standard error is given by

\widehat{\mathrm{se}}_{\mathrm{B}} ≤ft( \hat{θ} \right) = √{ \frac{1}{B - 1} ∑_{b = 1}^{B} ≤ft[ \hat{θ}^{*} ≤ft( b \right) - \hat{θ}^{*} ≤ft( \cdot \right) \right]^2 }

where

\hat{θ}^{*} ≤ft( \cdot \right) = \frac{1}{B} ∑_{b = 1}^{B} \hat{θ}^{*} ≤ft( b \right) .

In addition to the bias-correction \hat{z}_{0} discussed in bc(), the acceleration \hat{a}, which refers to the rate of change of the standard error of \hat{θ} with respect to the true parameter value θ, is factored in.

The acceleration \hat{a} is given by

\hat{a} = \frac{ ∑_{i = 1}^{n} ≤ft[ \hat{θ}_{ ≤ft( \cdot \right) } - \hat{θ}_{ ≤ft( i \right) } \right]^{3} } { 6 ≤ft\{ ∑_{i = 1}^{n} ≤ft[ \hat{θ}_{ ≤ft( \cdot \right) } - \hat{θ}_{ ≤ft( i \right)} \right]^{2} \right\}^{3/2} }

where

\hat{θ}_{ ≤ft( i \right) } = ≤ft\{ \hat{θ}_{≤ft( 1 \right)}, \hat{θ}_{≤ft( 2 \right)}, \hat{θ}_{≤ft( 3 \right)}, …, \hat{θ}_{≤ft( n \right)} \right\}

is the jackknife sampling distribution and

\hat{θ}_{ ≤ft( \cdot \right) } = \frac{1}{n} ∑_{i = 1}^{n} \hat{θ}_{ ≤ft( i \right) }

is the jackknife mean. See jack() and jack_hat() .

Using \hat{z}_{0} and \hat{a} we can obtain the adjusted z-scores as follows

z_{ \mathrm{BCa}_{\mathrm{lo}} } = \hat{z}_{0} + \frac{ \hat{z}_{0} + z_{ ≤ft( \frac{ α } { 2 } \right) } } { 1 - \hat{a} ≤ft[ \hat{z}_{0} + z_{ ≤ft( \frac{ α } { 2 } \right) } \right] } ,

z_{ \mathrm{BCa}_{\mathrm{up}} } = \hat{z}_{0} + \frac{ \hat{z}_{0} + z_{ ≤ft[ 1 - \frac{ α } { 2 } \right] } } { 1 - \hat{a} ≤ft[ \hat{z}_{0} + z_{ ≤ft( 1 - \frac{ α } { 2 } \right) } \right] } .

The adjusted z-scores are used to determine the adjusted percentile ranks to form the confidence interval.

The bias-corrected and accelerated confidence interval is given by

≤ft[ \hat{θ}_{\mathrm{lo}}, \hat{θ}_{\mathrm{up}} \right] = ≤ft[ \hat{θ}^{*}_{ ≤ft( z_{ \mathrm{BCa}_{ \mathrm{lo} } } \right) }, \hat{θ}^{*}_{ ≤ft( z_{ \mathrm{BCa}_{ \mathrm{up} } } \right) } \right] .

For more details and examples see the following vignettes:

Notes: Introduction to Nonparametric Bootstrapping

Notes: Introduction to Parametric Bootstrapping

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 ≤ft( \widehat{\mathrm{se}}_{\mathrm{B}} ≤ft( \hat{θ} \right) \right).

ci_

Estimated bias-corrected and accelerated confidence limits corresponding to alpha from the bootstrap sampling distribution thetahatstar ≤ft( \boldsymbol{\hat{θ}^{*}} \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.

Author(s)

Ivan Jacob Agaloos Pesigan

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(), bc(), pc()


jeksterslabds/jeksterslabRboot documentation built on July 20, 2020, 12:56 p.m.