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

Scripts - Bootstrap

Bootstrap command

Bootstrap(procedure,loops,matrixname) creates a matrix containing the bootstrap sampling distribution of various parameters estimated in a statistical procedure.

You can use this matrix in for example the Statistical functions to calculate the median and percentiles using the Median and Percentile functions, or calculate the number of values above or below a particular value using the CountIf conditional count function.

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


// set decimal symbol and list separator so that this example works on 
// systems that have different settings for decimal symbol and list separator
// the data
clear data;
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
// parameters for the statistical procedure
// call the bootstrap function
// display the results matrix

The bootstrap procedure creates a 3x100 matrix named bsresults with the results of 100 bootstrap iterations. Here are a few top rows for illustration:


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

The columns in the matrix are anonymous. To find out what they represent, use the PROC procedure as follows (see PROC command):


This procedures creates a table with name procresults:

Sample size20
Spearman's rho0.778947368
Kendall's Tau0.557894737

So the first column in the bsresults matrix created by the bootstrap procedure contains the sample size for each bootstrap sample, the 2nd column contains Spearman's rho and the 3rd column contains Kendall's Tau.


See also

External links

Recommended book

Book cover

An Introduction to the Bootstrap
Bradley Efron, R.J. Tibshirani

Buy from Amazon

Statistics is a subject of many uses and surprisingly few effective practitioners. The traditional road to statistical knowledge is blocked, for most, by a formidable wall of mathematics. The approach in An Introduction to the Bootstrap avoids that wall. It arms scientists and engineers, as well as statisticians, with the computational techniques they need to analyze and understand complicated data sets.