01 / 20

Bootstrap
Resampling

Learn how to estimate the variability of a statistic by resampling from your own data: no formulas for standard error required.

College Statistics

What Is the Bootstrap?

Imagine you collected a sample of \( n \) observations and computed a statistic: a mean, a median, a correlation. You want to know: how much would that statistic vary if you could repeat the whole study?

The bootstrap answers this by resampling with replacement from your original sample, over and over, to build an empirical picture of sampling variability.

Why Do We Need the Bootstrap?

No formula available
Some statistics (median, trimmed mean, ratio) have no simple formula for their standard error.
Small samples
With small \( n \), normal-theory approximations may be unreliable. The bootstrap lets the data speak for itself.
Flexibility
Works for almost any statistic: means, regression coefficients, correlation, percentiles, and more.

Sampling With Replacement

Original Sample 3 7 2 9 5 1
\( n = 6 \)
\( \bar{x} = 4.5 \)
resample resample resample B1: 7, 3, 7, 9, 5, 3
\( \bar{x}^* = 5.67 \)
B2: 2, 1, 5, 5, 9, 2
\( \bar{x}^* = 4.0 \)
B3: 9, 7, 1, 3, 9, 7
\( \bar{x}^* = 6.0 \)
. . .

The Bootstrap Algorithm

1
Start with your original sample of \( n \) observations and compute the statistic \( \hat{\theta} \).
2
Draw a bootstrap sample of size \( n \) from the original sample with replacement.
3
Compute the bootstrap statistic \( \hat{\theta}^* \) from this resample.
4
Repeat steps 2-3 a large number of times, typically \( B = 1{,}000 \) to \( 10{,}000 \).
5
Analyze the distribution of the \( B \) bootstrap statistics: compute the standard error, build a confidence interval, etc.

The Bootstrap Distribution

Frequency
Bootstrap statistic \( \hat{\theta}^* \)
\( \hat{\theta} \)
Bootstrap SE

Bootstrap Standard Error

The bootstrap standard error is simply the standard deviation of the \( B \) bootstrap statistics:

where \( \overline{\hat{\theta}^*} = \frac{1}{B}\sum_{b=1}^{B}\hat{\theta}^*_b \) is the mean of the bootstrap statistics. This is exactly the sample standard deviation formula applied to the list of bootstrap replicates.

Bootstrap Confidence Interval

The simplest bootstrap confidence interval is the percentile method: use the quantiles of the bootstrap distribution directly.

Percentile Method
Use the \( \alpha/2 \) and \( 1-\alpha/2 \) quantiles directly from the bootstrap distribution.
Normal Interval
\( \hat{\theta} \pm z^* \cdot \text{SE}_{\text{boot}} \). Assumes the bootstrap distribution is approximately normal.

Bootstrap vs. Traditional Inference

Bootstrap Traditional
Assumptions Minimal: sample is representative Often requires normality or large \( n \)
SE Formula Computed from resamples Derived analytically (e.g., \( s/\sqrt{n} \))
Applicability Any statistic Limited to known distributions
Computation Requires many iterations Usually one formula
Accuracy Improves with more resamples Improves with larger \( n \)

How to Apply the Bootstrap

1
Collect your data. You have \( n \) observations: \( x_1, x_2, \ldots, x_n \).
2
Choose a statistic. Decide on \( \hat{\theta} \): mean, median, proportion, correlation, etc.
3
Set \( B \). Choose the number of bootstrap replicates: \( B \geq 1{,}000 \) for SE, \( B \geq 10{,}000 \) for CI endpoints.
4
Resample and compute. For each \( b = 1, \ldots, B \): draw \( n \) values with replacement, compute \( \hat{\theta}^*_b \).
5
Summarize. Report the bootstrap SE and/or percentile CI from the collection of \( \hat{\theta}^*_b \) values.

Example 1: Bootstrap SE of the Mean

A sample of \( n = 5 \) test scores: {72, 85, 90, 68, 79}. The sample mean is \( \bar{x} = 78.8 \). We draw \( B = 4 \) bootstrap samples (just to illustrate):

Resample Values drawn
\( \bar{x}^* \)
B1 85, 72, 85, 90, 68 80.0 B2 68, 68, 79, 90, 72 75.4 B3 90, 90, 85, 79, 85 85.8 B4 79, 72, 68, 72, 90 76.2

Example 2: Bootstrap CI for the Median

A researcher measures reaction times (ms) for \( n = 8 \) subjects: {230, 245, 260, 275, 310, 340, 390, 520}. The sample median is 292.5 ms.

She generates \( B = 10{,}000 \) bootstrap medians. The sorted bootstrap medians give:

2.5th Percentile
\( \hat{\theta}^*_{(0.025)} = 252.5 \) ms
97.5th Percentile
\( \hat{\theta}^*_{(0.975)} = 365.0 \) ms

Example 3: Bootstrap for Correlation

We have \( n = 15 \) paired observations of study hours and exam score. The sample correlation is \( r = 0.72 \).

Bootstrap \( r^* \)
Count
\( r = 0.72 \)
95% CI: [0.38, 0.89]

When Does It Work (and Not)?

✓ Works well
Sample is representative; statistic is "smooth" (means, proportions, regression coefficients).
✕ Struggles
Very small \( n \), extreme outliers dominate, or the statistic depends on rare events (e.g., max or min).

Common Mistakes

✕ Wrong sample size
Each bootstrap sample must be size \( n \), not smaller. Drawing fewer observations changes the variability.
✕ Sampling without replacement
Without replacement, every resample is identical to the original. Replacement is essential.
✕ Too few replicates
Using \( B = 50 \) gives noisy estimates. Use at least \( B = 1{,}000 \) for SE and \( B \geq 10{,}000 \) for confidence intervals.

Bootstrap Summary

Concept Details
Input Original sample of \( n \) observations
Resampling Draw \( n \) values with replacement
Replicates \( B \geq 1{,}000 \) (more for CIs)
Bootstrap SE SD of the \( B \) bootstrap statistics
Percentile CI Quantiles at \( \alpha/2 \) and \( 1-\alpha/2 \)
Key Assumption Sample is representative of the population

Question 1 of 5

In bootstrap resampling, each bootstrap sample is drawn from the original data with replacement. What happens if you accidentally sample without replacement?

Question 2 of 5

You have a sample of \( n = 20 \) and generate \( B = 5{,}000 \) bootstrap resamples. How large is each bootstrap sample?

Question 3 of 5

The bootstrap standard error is computed as the _____ of the \( B \) bootstrap statistics.

Question 4 of 5

To construct a 95% bootstrap percentile confidence interval, you take the _____ percentiles of the bootstrap distribution.

Question 5 of 5

A major advantage of the bootstrap over traditional methods is that it: