Calculates percentile confidence intervals.
pc( 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 percentile 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) . $$
Note that \( \widehat{\mathrm{se}}_{\mathrm{B}} \left( \hat{\theta} \right) \) is the standard deviation of \( \boldsymbol{\hat{\theta}^{*}} \) and \( \hat{\theta}^{*} \left( \cdot \right) \) is the mean of \( \boldsymbol{\hat{\theta}^{*}} \) .
The percentile confidence interval is given by $$ \left[ \hat{\theta}_{\mathrm{lo}}, \hat{\theta}_{\mathrm{up}} \right] = \left[ \hat{\theta}^{*}_{z_{\left( \frac{\alpha}{2} \right)}}, \hat{\theta}^{*}_{z_{\left( 1 - \frac{\alpha}{2} \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.