Introduction to boot


Jeremy Foote

Bootstrapping

What is it?

  • Calculating the statistic of interest on “bootstrap resamples” of data
    • Resamples come by sampling with replacement many times
  • Seeing Theory

What is the point?

  • Estimate statistics when assumptions of parametric models may not hold
  • Reduce distortions caused by small sample size

What’s the catch?

  • Has its own assumptions:
    • Sample is representative of population
    • Samples are independent

Boot package

Basic function

Estimating the mean

Estimating the mean - visualization

Advanced example - bootstrapped confidence intervals for regression

  • This should be easier!

Visualize bootstrapped coefficients

Calculate confidence intervals

##       (Intercept)        wt          hp        disp
## 2.5%     32.33534 -5.861030 -0.06023895 -0.01733316
## 97.5%    42.02881 -1.857575 -0.01681910  0.01675699
##      (Intercept)        wt          hp        disp
## [1,]    31.95369 -5.576118 -0.05609859 -0.02235941
## [2,]    41.76300 -1.521268 -0.01415651  0.01381162

Use bootstrapped confidence intervals

The End