BootStrapPackage: A Package of Bootstrap Algorithms for Mean, Simple Linear Regression Models and Correlation Coefficient.

Enis SINIKSARAN

Assistant Professor of Statistics
Istanbul University, Faculty of Economics, Department of Econometrics
Beyazit-Istanbul, Turkey
saran@istanbul.edu.tr

Created : June, 2001

Assume that we wish to make an inference about a population parameter θ and let (Overscript[θ, ∧]) be an estimator of θ. In some cases , however, an analytic estimate of the standard error of (Overscript[θ, ∧]) is too difficult or impossible to obtain. In some other cases, we would not be satisfied with the results of the asymptotic theory as to  the accuracy of  (Overscript[θ, ∧]).  Bootstrap which is a
computer-based method for statistical inference would be a remedy to  these circumstances. The algorithm of the bootstrap methods is as follows.  Let us have a sample of size n, say χ . Resample with replacement from this data to get a bootstrap sample, say  \(\(χ\^*\)\_i\), of the same size as our original sample χ.  Select B independent bootstrap samples, say
 \(\(χ\^*\)\_1\), \(\(χ\^*\)\_2\),...,\(\(χ\^*\)\_B\).  Calculate the value of the statistic (Overscript[θ, ∧]) for each bootstrap sample, say  \(TraditionalForm\`\(θ\&∧\^*\)\_1\),  \(TraditionalForm\`\(θ\&∧\^*\)\_2\),..., \(TraditionalForm\`\(θ\&∧\^*\)\_B\). These B  \(TraditionalForm\`\(θ\&∧\^*\)\) 's 
  provide us the information to make inferences from our original data. If we wish to know , for instance, the standard error of (Overscript[θ, ∧])  we can use  these B replications.  The sample standard deviation of B replications  \(TraditionalForm\`\(θ\&∧\^*\)\_1\),  \(TraditionalForm\`\(θ\&∧\^*\)\_2\),..., \(TraditionalForm\`\(θ\&∧\^*\)\_B\)   is the bootstrap standard error of  (Overscript[θ, ∧]):                          
                                   
                   (Subscript[(Overscript[se, ∧]), boot]) =  ((((∑_(i = 1)^B)(((( \(\(\(θ\&∧\^*\)\_i\)\(\ \)\(-\)\(\ \)\) \(θ\&∧\^*\)(.)))^2)/B)))^(1/2))
                   
                   
   where      \(TraditionalForm\`\(θ\&∧\^*\)\)(.) =(∑_(i = 1)^B)(( \(\(θ\&∧\^*\)\_i\))/B)  .Our approximation to standard error of   (Overscript[θ, ∧])  can be made arbitrarily accurate by taking  
   
   B  to be arbitrarily large.  
   
         BootStrapPackage is designed to produce some summary statistics and confidence intervals based on bootstrap percentiles and BCa percentiles for the mean, simple linear regression and correlation coefficient. There are four user functions in this package:BootMean[list,B], BootRegPair[data,B], BootRegRes[data,B], BootCorr[data,B]

Sample Uses For The Package

Read the package

<< BootStrapPackage.m

Sample Hypothetical  Data

data = {{123. , 76}, {109, 70}, {62, 55}, {104, 71}, {57.00, 
            55}, {37, 48}, {44, 50}, {100, 66}, {16, 41}, {28, 43}, {138, 
            82}, {105, 68}, {159, 88}, {75, 58}, {88, 64}, {164, 88}, {169, 
            89}, {167, 88}, {149, 84}, {167, 
            88}};

list = {12, 15, 19, 16, 18, 15, 29, 32, 25, 31, 26, 19, 
          20};

Bootstrapping Mean

?BootMean

50 Replications

BootMean[list, 50]

1000 Replications

BootMean[list, 1000]

Bootstrapping Simple Linear Regression

There are two basic ways of  bootstrapping a regression model: Bootstrapping  pairs and bootstrapping residuals.
Two methods may give different results depending on the structure of your data. Which model is more reliable? 
The answer depends on how far we trust the assumptions of our model.

Bootstrapping Pairs

?BootRegPair

150 Replications

BootRegPair[data, 150]

Bootstrapping Residuals

?BootRegRes

150 Replications

BootRegRes[data, 150]

Bootstrapping Correlation Coefficient

?BootCorr

250 Replications

BootCorr[data, 250]