Skip to content

Bootstrap Estimates Standard Error From One Dataset

The bootstrap estimates how much a statistic would vary from sample to sample, using only the one sample you have and resampling it with replacement. James, Witten, Hastie, and Tibshirani introduce it in Section 5.2 of their book. You cannot usually draw new datasets from the real population, so you "obtain distinct data sets by repeatedly sampling observations from the original data set." The sampling is done with replacement, "which means that the same observation can occur more than once in the bootstrap data set." Each bootstrap dataset has the same size n as the original. You compute your statistic on each one, repeat B times, and use the spread of those B values to estimate the standard error: SE_B = √[(1/(B − 1)) Σ (θ̂_r − mean of the θ̂)²] (their Equation 5.8).

The authors' own picture is a dataset with n = 3 observations. One bootstrap dataset contains the third observation twice, the first once, and the second not at all. They note that if an observation is included, both its X and Y values come along. On their simulated example, the bootstrap standard error of their estimate is 0.087, very close to the 0.083 they get from 1,000 datasets simulated from the true population.

Try it by hand. Take a tiny dataset of three values: 2, 4, and 9, with mean 5. Draw 3 values with replacement. There are 3 × 3 × 3 = 27 equally likely resamples, such as (2, 2, 9) or (4, 9, 9). Compute the mean of each. The 27 means average exactly 5, and their variance is 26/9 = 2.89, so the bootstrap standard error of the mean is √(26/9) = 1.70. That is the "ideal" bootstrap using every resample. With a large number B of randomly drawn resamples, Equation 5.8 approximates it. For comparison, the usual formula s/√n uses s² = ((−3)² + (−1)² + 4²)/2 = 13, so SE = √(13/3) = 2.08. The two answers differ a little, because the bootstrap variance of the mean is the data's variance with divisor n, 26/3, divided by n: 26/9. The bootstrap is an approximation, and with three points a rough one. The values here are invented, and I enumerated all 27 resamples in exact fractions.

Look at what the resamples contain. Only the values 2, 4, and 9. The means include 2, 8/3, 10/3, and so on up to 9, but no resample ever holds a 6 or a 7. A given original value appears in a resample with probability 1 − (2/3)³ = 19/27 = 0.70. A bootstrap sample reshuffles what you saw. It does not reveal values you did not see.

The book adds a practical point: the bootstrap "can be applied in almost all situations" and "no complicated mathematical calculations are required."

The trap: treating a bootstrap sample as a fresh, independent dataset from the real population. It is a resample of your own data, so it inherits that data's quirks and cannot show you what the data missed. The ordinary case bootstrap here assumes the observations are independent. For grouped or time-ordered data you need a version that respects that structure. (That last remark is my addition, not from the section I read.)

Prof Rod's rule: use the bootstrap to see how much your estimate wobbles, and remember it wobbles only around the data you have.

James, Witten, Hastie, and Tibshirani, An Introduction to Statistical Learning, 2nd ed., Section 5.2 (pp. 209–212, Equation 5.8, Figure 5.11) and Section 5.3.4 (p. 216)