Tutorials › Introduction to Statistics › Basic Bootstrap Confidence Intervals

Bootstrap and Permutation Methods · Tutorial 976 of 996

Basic Bootstrap Confidence Intervals

Use bootstrap errors to reflect quantiles around an observed statistic, then compare the resulting basic interval with a percentile interval.

Intermediate 9 min read

What You'll Learn

  • Define bootstrap errors as the difference between a bootstrap estimate and the observed estimate.
  • Construct a basic interval by reversing and reflecting bootstrap-error quantiles.
  • Convert percentile-interval endpoints into basic-interval endpoints.
  • Compare both intervals using numerical bootstrap summaries.
  • Interpret the intervals cautiously and identify conditions that can make bootstrap intervals unreliable.

Why Reflect Bootstrap Errors?

A percentile bootstrap confidence interval uses quantiles of the bootstrap estimates themselves. A basic bootstrap interval starts from a different quantity: the bootstrap error, or the difference between a bootstrap estimate and the statistic calculated from the original sample. It uses the quantiles of those errors to estimate how far the original statistic may be from the population parameter.

The distinction matters when the bootstrap distribution is shifted relative to the observed statistic. A basic interval reflects the bootstrap quantiles around that statistic, rather than using the quantiles directly as endpoints. This can move both endpoints and can change the interval’s location. The method is a useful alternative, not a guarantee that the resulting interval is more accurate.

Definition: Let \(\hat{\theta}\) be a statistic calculated from the original sample, and let \(\hat{\theta}^{*}\) be the same statistic calculated from a bootstrap resample. The bootstrap error is \(E^{*}=\hat{\theta}^{*}-\hat{\theta}\). For a confidence level \(1-\alpha\), let \(q^{*}_{\alpha/2}\) and \(q^{*}_{1-\alpha/2}\) be the lower and upper quantiles of the bootstrap-error distribution. The basic bootstrap interval is $$ \left[\hat{\theta}-q^{*}_{1-\alpha/2},\ \hat{\theta}-q^{*}_{\alpha/2}\right]. $$

A bootstrap resample is drawn from the observed data using the resampling scheme appropriate to the study design, and the statistic is recalculated for that resample. Repeating this process produces bootstrap estimates. For this tutorial, assume the bootstrap quantiles are estimated from a sufficiently large collection of resamples; small numerical examples below use fewer values only to make the arithmetic visible.

The quantile convention can affect computed endpoints slightly, especially with a small number of replicates. In the first two examples, use the nearest-rank convention: sort the values and take rank \(\lceil Bp\rceil\) for quantile level \(p\), where \(B\) is the number of values. In practical work, use the stated quantile method consistently and report it when relevant.

How the Basic Interval Is Derived

The construction follows from treating the bootstrap errors as approximations to the sampling errors of the original statistic. The sampling error is \(\hat{\theta}-\theta\), where \(\theta\) is the population parameter. If the bootstrap-error quantiles approximate the corresponding sampling-error quantiles, a central \(1-\alpha\) range for the sampling error is approximately \(q^{*}_{\alpha/2}\) to \(q^{*}_{1-\alpha/2}\).

1
Approximate the sampling-error range.
Use the bootstrap-error quantiles to approximate a range containing the central \(1-\alpha\) fraction of values of \(\hat{\theta}-\theta\).
2
Write the range as an inequality.
The approximation is \(q^{*}_{\alpha/2}\leq\hat{\theta}-\theta\leq q^{*}_{1-\alpha/2}\).
3
Solve for the parameter.
Subtracting the outer terms from \(\hat{\theta}\) reverses their order, giving \(\hat{\theta}-q^{*}_{1-\alpha/2}\leq\theta\leq\hat{\theta}-q^{*}_{\alpha/2}\).

This gives the basic interval. The order reversal is essential: the upper error quantile is subtracted to get the lower endpoint, and the lower error quantile is subtracted to get the upper endpoint. In general, bootstrap errors do not have to be symmetric around zero.

Worked Construction and Comparison

Worked Example: Reflecting Bootstrap Errors for a Mean

In a hypothetical analysis, the observed sample mean is \(\hat{\theta}=12\) units. Ten bootstrap resamples produce sorted estimates \(8, 9, 10, 11, 12, 13, 14, 16, 18, 22\). Construct an 80% percentile interval and an 80% basic interval, using the nearest-rank convention.

For an 80% interval, \(\alpha=0.20\), so the endpoint quantiles are the 10th and 90th percentiles. With \(B=10\), their ranks are \(\lceil10(0.10)\rceil=1\) and \(\lceil10(0.90)\rceil=9\). Thus the percentile interval is \([8,18]\).

For the basic interval, first calculate each bootstrap error by subtracting the observed mean, 12, from the corresponding bootstrap estimate. The sorted errors are \(-4,-3,-2,-1,0,1,2,4,6,10\). The 10th-percentile error is \(-4\), and the 90th-percentile error is \(6\).

$$ \left[12-6,\ 12-(-4)\right]=[6,16]\text{ units}. $$

The basic interval is therefore 6 to 16 units, while the percentile interval is 8 to 18 units. Both are 10 units wide in this example, but the basic interval is shifted downward. These are hypothetical results based on only ten resamples; a practical analysis would ordinarily use many more to estimate the quantiles more stably.

The relationship to the percentile interval can be written directly. Since \(E^{*}=\hat{\theta}^{*}-\hat{\theta}\), subtracting a constant shifts every quantile by that constant: \(q^{*}_{p}=q_{p}(\hat{\theta}^{*})-\hat{\theta}\), using the same quantile convention. Substituting this into the basic-interval formula gives the equivalent expression below.

$$ \begin{aligned} \left[\hat{\theta}-q^{*}_{1-\alpha/2},\ \hat{\theta}-q^{*}_{\alpha/2}\right] &= \left[\hat{\theta}-\{q_{1-\alpha/2}(\hat{\theta}^{*})-\hat{\theta}\},\ \hat{\theta}-\{q_{\alpha/2}(\hat{\theta}^{*})-\hat{\theta}\}\right]\\ &= \left[2\hat{\theta}-q_{1-\alpha/2}(\hat{\theta}^{*}),\ 2\hat{\theta}-q_{\alpha/2}(\hat{\theta}^{*})\right]. \end{aligned} $$

This is a reflection around \(\hat{\theta}\): each percentile endpoint is placed the same distance from the observed statistic on the opposite side. The basic interval need not have the same endpoints—or even the same width—as the percentile interval.

Worked Example: When the Bootstrap Distribution Is Shifted

Suppose a hypothetical statistic measuring average weekly time is \(\hat{\theta}=48\) hours. Ten bootstrap estimates, in sorted order, are \(40,42,43,44,45,46,47,50,54,62\). Find the 80% percentile and basic intervals using the same nearest-rank convention.

The 10th- and 90th-percentile bootstrap estimates are the first and ninth values, 40 and 54. Therefore the percentile interval is \([40,54]\) hours.

Subtract 48 hours from each estimate. The sorted bootstrap errors are \(-8,-6,-5,-4,-3,-2,-1,2,6,14\) hours. The corresponding endpoint error quantiles are \(-8\) and \(6\) hours. Thus the basic interval is

$$ \left[48-6,\ 48-(-8)\right]=[42,56]\text{ hours}. $$

The same result comes from reflecting the percentile endpoints around 48 hours: \(\left[2(48)-54,\ 2(48)-40\right]=[42,56]\) hours. Here the basic interval is shifted upward relative to the percentile interval. The example shows why it is important to calculate or transform the endpoints, rather than assume the two methods agree.

A Further Example: Reading Quantile Summaries

Worked Example: Calculating Endpoints from Reported Quantiles

In a hypothetical analysis of 30 water samples, the observed mean concentration is \(\hat{\theta}=6.4\) milligrams per litre (mg/L). A bootstrap run using 2,000 resamples reports a 2.5th percentile of 5.7 mg/L and a 97.5th percentile of 7.8 mg/L. Construct both 95% intervals.

The reported bootstrap-estimate quantiles directly give the 95% percentile interval: \([5.7,7.8]\) mg/L.

For the basic interval, express those endpoints as errors relative to the observed mean: \(5.7-6.4=-0.7\) mg/L and \(7.8-6.4=1.4\) mg/L. Applying the basic formula, subtract the upper error from the observed mean for the lower endpoint and the lower error for the upper endpoint:

$$ \left[6.4-1.4,\ 6.4-(-0.7)\right]=[5.0,7.1]\text{ mg/L}. $$

The basic interval is 5.0 to 7.1 mg/L. Its endpoints reflect the percentile endpoints around 6.4 mg/L: \(2(6.4)-7.8=5.0\), and \(2(6.4)-5.7=7.1\). Under the assumptions supporting the bootstrap procedure, the interval is intended to capture the population mean concentration at the 95% confidence level. It does not mean there is a 95% probability that this fixed mean lies in this particular interval.

Assumptions and Practical Cautions

A basic interval relies on the bootstrap distribution being informative about the sampling error of the statistic. In an ordinary nonparametric bootstrap for independent observations, resampling is with replacement from the observed sample, which serves as an empirical approximation to the population. The observations must reasonably represent the population relevant to the question. If the design involves pairing, grouping, clustering, or another dependence structure, resampling individual observations independently may be inappropriate; the resampling scheme must preserve the structure that generated the data.

The statistic must also be calculable for the resamples, and the sample must provide useful information about its sampling behavior. A bootstrap procedure cannot repair a biased or unrepresentative sample simply by resampling it. Nor does reflecting quantiles automatically correct every form of bias, skewness, or instability. In particular, an interval can extend into impossible values for a parameter, or have an endpoint whose position is implausible for the context. Such outcomes are reasons to examine the method and data, not to silently alter the result.

The interval is an approximation, not a finite-sample guarantee. Its quality depends on the statistic, the data, the sampling design, and how well the bootstrap distribution represents sampling uncertainty. More bootstrap resamples can reduce simulation noise in estimated quantiles, but cannot eliminate the limitations caused by an unsuitable sampling model or inadequate original data.

Common Mistake: Reversing the Wrong Endpoints

A frequent error is to subtract the lower bootstrap-error quantile first and call the result the lower endpoint. That produces \(\hat{\theta}-q^{*}_{\alpha/2}\) as the lower limit, even though it is the larger of the two limits when the lower error quantile is below the upper one. The correction is to reverse the quantiles when subtracting: the lower interval endpoint is \(\hat{\theta}-q^{*}_{1-\alpha/2}\), and the upper endpoint is \(\hat{\theta}-q^{*}_{\alpha/2}\).

Another common mistake is to report the percentile interval after calculating bootstrap errors. The two procedures are related, but the basic method reflects the endpoints around the observed statistic. Check the result by confirming that the basic interval equals \([2\hat{\theta}-\text{percentile upper endpoint},\,2\hat{\theta}-\text{percentile lower endpoint}]\).

Key takeaway: A basic bootstrap interval uses quantiles of \(\hat{\theta}^{*}-\hat{\theta}\), then subtracts the upper error quantile for the lower endpoint and the lower error quantile for the upper endpoint. Equivalently, it reflects the percentile interval around the observed statistic.

Check Your Understanding

Try these questions without looking back.

  1. Define the bootstrap error in terms of the original statistic and a bootstrap estimate.
  2. If \(\hat{\theta}=20\), and the lower and upper error quantiles are \(-3\) and \(5\), what is the basic interval?
  3. A percentile interval is \([12,18]\) and the observed statistic is 16. What is the corresponding basic interval?
  4. Why is the upper error quantile used to calculate the lower endpoint of a basic interval?
  5. Why does increasing the number of bootstrap resamples not fix an unrepresentative original sample?