Bootstrap Confidence Interval Calculator
Estimate CIs via resampling.
Uses quantiles of bootstrap distribution directly
Use same seed for reproducible results
Enter data and click 'Run Bootstrap' to calculate CI
Use bootstrap confidence intervals when you can't assume normality, have small samples, or need intervals for complex statistics like medians, ratios, or percentiles. Bootstrap resampling makes no distributional assumptions.
What Is Bootstrapping?
Bootstrapping creates many resampled datasets by drawing with replacement from your original data, then calculates your statistic on each resample:
- Original sample: n observations
- Draw n observations with replacement β Bootstrap sample 1
- Calculate statistic on bootstrap sample 1
- Repeat B times (typically 1000-10000)
- Use the distribution of bootstrap statistics for inference
Bootstrap CI Methods
Percentile Method
The simplest approach: use percentiles of the bootstrap distribution.
Where is the p-th percentile of bootstrap statistics.
Pros: Simple, intuitive Cons: Can be biased, poor coverage for skewed distributions
Basic (Reverse Percentile) Method
Where is the original sample estimate.
Reflects the bootstrap distribution around the original estimate.
Bias-Corrected and Accelerated (BCa)
The gold standard for bootstrap CIs:
Where:
- = bias correction (proportion of bootstrap estimates below original)
- = acceleration (measures skewness)
Pros: Best coverage, handles bias and skewness Cons: Computationally intensive, requires more bootstrap samples
Studentized (Bootstrap-t)
Uses the distribution of studentized statistics:
Requires estimating SE for each bootstrap sample.
Example: Bootstrap CI for Median
Data: 12, 15, 18, 22, 25, 28, 45, 52 (n = 8)
Original median: 23.5
1000 Bootstrap samples give medians:
- 2.5th percentile: 17.5
- 97.5th percentile: 38.5
95% Percentile CI: [17.5, 38.5]
Compare to: No simple formula exists for median CI with normal theory!
How Many Bootstrap Samples?
| Purpose | Recommended B |
|---|---|
| Standard error | 200-500 |
| Confidence intervals | 1000-2000 |
| Percentile CI | 1000 |
| BCa CI | 2000-5000 |
| Hypothesis testing | 1000-10000 |
More samples = more precise, but diminishing returns after ~10,000.
When to Use Bootstrap CIs
Ideal Situations
- Non-normal data: Skewed distributions, outliers
- Small samples: n < 30 where CLT is questionable
- Complex statistics: Median, trimmed mean, ratios, percentiles
- No closed-form SE: Correlation differences, regression predictions
- Dependent data: Time series (use block bootstrap)
When NOT to Use
- Very small samples: n < 10 may not capture population variability
- Heavy tails with tiny n: Bootstrap can be unstable
- Simple statistics with large n: Normal theory is fine and faster
Bootstrap for Different Statistics
Mean
Bootstrap is unnecessary for large n (use normal theory), but valid for small n or non-normal data.
Median
No simple formula for median SE. Bootstrap is often the best approach:
Correlation
Bootstrap handles the non-normal sampling distribution of r.
Regression Coefficients
Resample (X, Y) pairs together:
Accounts for heteroscedasticity without assuming it.
Difference in Means
Resample each group separately:
Valid even with unequal variances and non-normality.
Parametric vs. Nonparametric Bootstrap
Nonparametric Bootstrap
Resample from the data itself. Makes no distributional assumptions.
Parametric Bootstrap
- Fit a model to data (e.g., estimate ΞΌ, Ο)
- Generate samples from the fitted model
- Calculate statistic on each generated sample
Use when: You're confident in the distributional form but uncertain about parameters.
Block Bootstrap for Dependent Data
For time series or spatial data, observations aren't independent. Block bootstrap preserves local dependence:
- Divide data into overlapping blocks
- Resample blocks (not individual observations)
- Concatenate to form bootstrap sample
Block size requires tuningβtoo small ignores dependence, too large reduces variability.
Checking Bootstrap Results
Convergence
Increase B until SE of bootstrap SE stabilizes:
Bias
If bias is large relative to SE, consider BCa method.
Normality of Bootstrap Distribution
If bootstrap distribution is highly non-normal, percentile method may have poor coverage. Use BCa.
Common Mistakes
Resampling Wrong Units
For clustered data, resample clusters, not observations. For paired data, resample pairs.
Ignoring Dependence
Standard bootstrap assumes independence. Use block bootstrap for time series.
Too Few Bootstrap Samples
B = 100 is too few for CIs. Use at least 1000.
Expecting Miracles with Tiny n
Bootstrap can't create information that isn't in your sample. With n = 5, your CI will be wide regardless.
Comparison to Other Methods
| Method | Assumptions | Best For |
|---|---|---|
| Normal theory | Normality, large n | Means with large samples |
| t-interval | Normality (robust) | Small sample means |
| Bootstrap | None (IID) | Complex statistics, non-normal data |
| Bayesian | Prior specification | Incorporating prior knowledge |
Reporting Bootstrap Results
Standard format: "The median response time was 23.5 ms (95% BCa bootstrap CI: 17.5β38.5 ms, B = 5000)."
Include:
- Original estimate
- CI method (percentile, BCa, etc.)
- Number of bootstrap samples
- Any special considerations (block size for time series)
Computational Considerations
Efficiency Tips
- Vectorize operations
- Use parallel processing for large B
- Store only needed statistics, not full resamples
- Consider subsampling for huge datasets
Reproducibility
Set random seed before bootstrapping for reproducible results.
Historical Context
Bradley Efron introduced the bootstrap in 1979, revolutionizing statistical inference. The BCa method (1987) improved coverage properties. Advances in computing made the bootstrap practical, fundamentally changing how statisticians approach complex inference problems.
Related Calculations
- Confidence Interval Calculator β Parametric intervals
- T-Test Calculator β Hypothesis testing
- Standard Error Calculator β SE estimation
- Median Calculator β Central tendency
Summary
Bootstrap confidence intervals work by resampling your data with replacement, computing the statistic of interest many times, and using the resulting distribution for inference. The percentile method is simplest but BCa is preferred for its better coverage properties. Use bootstrap when normality is questionable, samples are small, or for statistics without closed-form standard errors. Choose at least 1000 resamples for CIs, 2000+ for BCa. Report the method used and number of bootstrap samples.