Computes percentile confidence interval(s) directly from a vector (or row-
major matrix) of bootstrap statistics.
-- Function File: CI = bootint (BOOTSTAT)
-- Function File: CI = bootint (BOOTSTAT, PROB)
-- Function File: CI = bootint (BOOTSTAT, PROB, ORIGINAL)
'CI = bootint (BOOTSTAT)' computes simple 95% percentile confidence
intervals [1,2] directly from the vector, or rows* of the matrix in
BOOTSTAT, where BOOTSTAT contains bootstrap statistics such as those
generated using the `bootstrp` function. Depending on the application,
bootstrap confidence intervals with better coverage and accuracy can
be computed using the various dedicated bootstrap confidence interval
functions from the statistics-resampling package.
* The matrix should have dimensions P * NBOOT, where P corresponds to
the number of parameter estimates and NBOOT corresponds to the number
of bootstrap samples.
'CI = bootint (BOOTSTAT, PROB)' returns confidence intervals, where
PROB is numeric and sets the lower and upper bounds of the confidence
interval(s). The value(s) of PROB must be between 0 and 1. PROB can
either be:
<> scalar: To set the central mass of normal confidence intervals
to 100*PROB%
<> vector: A pair of probabilities defining the lower and upper
percentiles of the confidence interval(s) as 100*(PROB(1))%
and 100*(PROB(2))% respectively.
The default value of PROB is the vector: [0.025, 0.975], for an
equal-tailed 95% percentile confidence interval.
'CI = bootint (BOOTSTAT, PROB, ORIGINAL)' uses the ORIGINAL estimates
associated with BOOTSTAT to correct PROB and the resulting confidence
intervals (CI) for median bias. The confidence intervals returned in CI
therefore become bias-corrected percentile intervals [3,4].
BIBLIOGRAPHY:
[1] Efron (1979) Bootstrap Methods: Another look at the jackknife.
Annals Stat. 7,1-26
[2] Efron, and Tibshirani (1993) An Introduction to the Bootstrap.
New York, NY: Chapman & Hall
[3] Efron (1981) Nonparametric Standard Errors and Confidence Intervals.
Can J Stat. 9(2):139-172
[4] Efron (1982) The jackknife, the bootstrap, and other resampling plans.
SIAM-NSF, CBMS #38
bootint (version 2024.05.19)
Author: Andrew Charles Penn
https://www.researchgate.net/profile/Andrew_Penn/
Copyright 2019 Andrew Charles Penn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
The following code
% Law school data
data = [576, 3.39; 635, 3.30; 558, 2.81; 578, 3.03; 666, 3.44; ...
580, 3.07; 555, 3.00; 661, 3.43; 661, 3.36; 605, 3.13; ...
653, 3.12; 575, 2.74; 545, 2.76; 572, 2.88; 594, 2.96];
x = data(:, 1);
y = data(:, 2);
r = cor (x, y);
% 95% confidence interval for the mean
bootstat = bootstrp (4999, @cor, x, y);
CI_per = bootint (bootstat,0.95) % 95% simple percentile interval
CI_cper = bootint (bootstat,0.95,r) % 95% bias-corrected percentile interval
% Please be patient, the calculations will be completed soon...
Produces the following output
CI_per =
0.45985 0.96204
CI_cper =
0.41869 0.95609
Package: statistics-resampling