Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

Scripts - Bootstrap confidence intervals

BootstrapCI command

BootstrapCI(procedure,loops,ci,tablename) creates a table containing ci% bootstrap confidence intervals of various parameters estimated in a statistical procedure. The ci parameter is a number between 0 and 100, for example 95 for 95% confidence intervals

The following statistical procedures are enabled for the Bootstrap command (more will follow in coming MedCalc updates):

  • MEANS
  • CORRELATION, RANKCORRELATION, PARTIALCORRELATION, REGRESSION
  • ONESAMPLETTEST, TTESTPAIRED, TTEST, FTEST,
  • YUENWELCHTEST
  • SIGNEDRANKSUMTEST, WILCOXON, MANNWHITNEY,
  • RELATIVERISK, MCNEMAR
  • BLANDALTMAN, PASSINGBABLOK, DEMING
  • CVFROMDUPLICATES
  • CONCORDANCE, KAPPA

BootstrapBCaCI command

BootstrapBCaCI(procedure,loops,ci,tablename) creates a table containing bias-corrected and accelerated (BCa) bootstrap ci% intervals of various parameters estimated in a statistical procedure. The ci parameter is a number between 0 and 100, for example 95 for 95% confidence intervals.

The following statistical procedures are enabled for the BootstrapBCaCI command (more will follow in coming MedCalc updates):

  • MEANS
  • CORRELATION, RANKCORRELATION, PARTIALCORRELATION, REGRESSION
  • ONESAMPLETTEST, TTESTPAIRED,
  • SIGNEDRANKSUMTEST, WILCOXON
  • RELATIVERISK, MCNEMAR
  • BLANDALTMAN, PASSINGBABLOK, DEMING
  • CVFROMDUPLICATES
  • CONCORDANCE, KAPPA

Notes

  • During bootstrapping, subgroups are ignored.
  • During execution, bootstrap procedures in the statistical procedure itself are disabled.
  • When logarithmic transformation (or Box-Cox transformation) is applied, the reported results are not back-transformed to their original scale.

Example

// set decimal symbol and list separator so that this example works on 
// systems that have different settings for decimal symbol and list separator
$decimalsymbol=".";
$listseparator=",";
// the data
clear data;
<data>
SHBG    TESTO
24.7    448.5
38      855.5
51.1    622
22.6    302
20.7    338.5
67.2    667.5
62.5    584
24.8    495
32.4    484
27.4    494.5
39.8    533
43.3    687.5
36.8    632.5
44.4    524
33.6    494
26.9    474
53.9    604
26.6    436
42.5    689.5
30.3    431.5
</data>
// parameters for the statistical procedure
$VariableX="SHBG";
$VariableY="TESTO";
$Filter="";
$RankCoefficients=BOTH;
// call the bootstrapBCaCI function
bootstrapBCaCI(RANKCORRELATION,5000,95,bsresults);
// display the results table
?bsresults;

The bootstrap procedure creates a table named bsresults:

StatisticEstimate95 CI - Lower95 CI - Upper
Sample size202020
Spearman's rho0.7789473680.5454309360.91090622
Kendall's Tau0.5578947370.2646939110.738636364

When you run this example, these results will be different. That is the nature of the bootstrap method.

See also

External links