Bootstrap confidence intervals resample the data to bound any one- or two-sample statistic, including those with no analytic standard error.
The bootstrap resamples with replacement from the original data B times, recomputes the statistic on each resample, and uses the resulting distribution to construct a CI. The key insight (Efron 1979): the variability of the statistic across bootstrap resamples mirrors its variability across hypothetical samples from the true population.
Three CI flavours: percentile (the 2.5th and 97.5th quantiles of the bootstrap distribution — simplest), basic (reflects around the observed value — corrects mild bias), BCa (bias-corrected and accelerated — corrects for both bias and skew, the standard for inference where you want a real CI).
Use the bootstrap for statistics with no closed-form SE: medians, IQRs, ratios of means, correlations of paired bootstraps, area under a curve. For routine statistics (mean, proportion) the analytic CIs are usually fine and faster.
One or two numeric columns + statistic + R (number of resamples) + CI method + optional seed.
Observed statistic, bootstrap SE, bias, lower / upper CI bounds. BCa diagnostics z₀ + a when chosen.
R = 1000 is enough for percentile / basic; R = 5000–10000 for BCa (extreme quantiles need more reps).
BCa is the right default for asymmetric distributions (medians, ratios). Percentile is acceptable for nearly-symmetric distributions and easier to explain.