pc: Confidence Interval - Percentile

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

View source: R/boot_ci.R

Description

Calculates percentile confidence intervals.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pc(
  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 ≤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.

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) .

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) .

Note that \widehat{\mathrm{se}}_{\mathrm{B}} ≤ft( \hat{θ} \right) is the standard deviation of \boldsymbol{\hat{θ}^{*}} and \hat{θ}^{*} ≤ft( \cdot \right) is the mean of \boldsymbol{\hat{θ}^{*}} .

The percentile confidence interval is given by

≤ft[ \hat{θ}_{\mathrm{lo}}, \hat{θ}_{\mathrm{up}} \right] = ≤ft[ \hat{θ}^{*}_{z_{≤ft( \frac{α}{2} \right)}}, \hat{θ}^{*}_{z_{≤ft( 1 - \frac{α}{2} \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 percentile 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(), bca(), bc()


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