- Introduced by
- Davison & Hinkley; Cameron, Gelbach & Miller
- Year
- 1997-2008
- Type
- resampling simulation
- Family
- Bayesian / computational
What does it do?
Hierarchical bootstrap simulation is a resampling technique for data with nested or clustered structure, such as students within schools, patients within hospitals, or repeated measures within subjects.
It keeps the grouping of the data by resampling at each level of the hierarchy in sequence. For many estimators this allows the bootstrap distribution to reflect both between-group and within-group variability, although the appropriate design should be checked for each statistic.
The intuition behind the method
Ordinary bootstrap treats every observation as independent and resamples observations freely. When data are nested, this breaks the grouping and tends to understate the uncertainty created by cluster-level variation. Hierarchical bootstrap resamples groups first and then observations within the selected groups, mimicking the data-generating process level by level. The resulting distribution carries uncertainty from each level, which matters most when observations within a cluster are correlated.
History
Bootstrap resampling was introduced by Efron (1979) for independent and identically distributed data. Davison and Hinkley (1997) present bootstrap methods in book form, including their use for data beyond simple independent samples. Cameron, Gelbach and Miller (2008) studied cluster bootstrap-t inference for clustered errors when the number of clusters is small, reporting that it reduces over-rejection relative to standard cluster-robust tests. Resampling schemes for nested data build on this cluster-level approach. The full multi-level scheme does not have a single standard originator, so its details vary between applications.
When to use it
Choose hierarchical bootstrap when observations are nested or clustered (students in schools, patients in clinics, repeated measures on subjects) and the target is a statistic whose variance has no convenient analytical form, such as an ICC or a cross-level interaction. It is relevant when the number of clusters may be too small for cluster-robust asymptotic standard errors to be trusted. Cameron, Gelbach and Miller (2008) report that standard asymptotic tests can over-reject with five to thirty clusters. This range is a rough guide, not a sharp cut-off for the bootstrap. Do not use it when there is no clustering: if data come from simple random sampling, the ordinary bootstrap is sufficient and the hierarchical scheme only adds complexity. With very few clusters, resampling clusters cannot produce a reliable distribution, so alternatives such as the wild cluster bootstrap should be considered.
Limitations and considerations
- Computationally expensive: each replicate requires refitting the model to a new dataset, and many replicates are needed.
- With very few clusters there are too few distinct groups to resample, so the bootstrap distribution is coarse and its tails are unreliable.
- Requires the analyst to specify the hierarchy and resampling order correctly; resampling at the wrong level produces a variance that does not match the design.
- Resampling clusters with replacement repeats some clusters within a replicate. If the fitting software treats repeated cluster identifiers as the same group, the within-cluster structure is misread, so repeated clusters must be relabelled as distinct units.
- Assumes that the observed clusters are approximately independent draws from a larger population of clusters, that observations are exchangeable within clusters, and that the estimator is stable under resampling. When these assumptions are doubtful, the intervals may not match the actual uncertainty.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Keeps the nested structure in every replicate, so between-cluster and within-cluster variation both enter the bootstrap distribution; observation-level resampling omits the between-cluster part.
- Does not require a parametric distribution for the statistic; intervals come from the empirical bootstrap distribution, so no analytical variance formula is needed.
- Cameron, Gelbach and Miller (2008) studied a cluster bootstrap-t procedure, which resamples whole clusters at a single level. They found that it reduces the over-rejection of standard cluster-robust tests when there are few clusters; in their Monte Carlo example, rejection rates of 10% fell to the nominal 5%.
- Applies to any estimator that can be computed on a resampled dataset, including nonlinear functionals such as ICCs.
- Extends to three or more levels by adding one resampling step per additional level.
Applications
- Education research: bootstrapping standard errors for school- or district-level effects on student outcomes.
- Clinical trials with site-level clustering: constructing confidence intervals for treatment effects when patients are nested within hospitals.
- Ecology and environmental science: inference on species-level parameters from repeated measurements within plots or transects.
- Survey sampling: resampling primary sampling units to propagate design-based uncertainty into model estimates.
- Longitudinal panel data: obtaining valid standard errors for fixed or random effects when repeated observations are correlated within individuals.
How it works
How it works
Map the grouping structure of the data, for example Level 1: measurements, Level 2: subjects, Level 3: sites. Each grouping level is a potential source of variation, so every level that affects the estimate must be identified before resampling.
At the highest relevant level, draw groups with replacement, using the same number of groups as in the original data. If there are G schools, draw G schools with replacement; some schools appear more than once in a replicate and others are absent. This step carries between-cluster variation into the bootstrap distribution.
Within each selected group, draw observations with replacement, separately for each selected group. Repeat this for each lower level of the hierarchy so that the nesting is preserved in every replicate. Resampling both stages is one option. For some estimators it can overstate variance, so compare the result with cluster-only resampling and check it against the study design before relying on it.
Apply the estimator of interest (mean, regression coefficient, ICC, or another functional) to the resampled hierarchical dataset to obtain one bootstrap replicate, denoted theta-star.
Formula
\hat{\theta}^* = f(X^*)Repeat the resampling and estimation steps many times (typically 1,000-10,000) to build the bootstrap distribution. Use it to estimate standard errors, bias, and percentile or BCa confidence intervals. These do not require the statistic to be normally distributed, although accuracy still depends on the number of clusters.
Common pitfalls
- Resampling only at the observation level and ignoring the cluster structure. This is the classic mistake that produces anticonservative confidence intervals.
- Using too few bootstrap replicates. Stability should be checked directly: compare interval endpoints across independent runs and increase the number of replicates until they agree closely.
- Choosing the resampling level without comparing the number of clusters with their sizes. When there are few large clusters, a handful of groups can drive the result, so the bootstrap distribution should be checked for sensitivity to individual clusters before intervals are reported.
- Treating the bootstrap intervals as exact when the number of higher-level units is small. In such cases the intervals are approximate and should be interpreted cautiously, with alternatives such as the wild cluster bootstrap considered.
Frequently asked questions
How does hierarchical bootstrap differ from ordinary bootstrap?
Ordinary bootstrap resamples individual observations independently, which is valid only when observations are independent. Hierarchical bootstrap resamples at each level of the hierarchy, first groups and then units within the selected groups, so the within-group correlation is carried into each replicate. Ignoring the clustering with ordinary bootstrap generally yields standard errors that are too small and confidence intervals that are too narrow.
How many bootstrap replicates do I need?
As rules of thumb, around 1,000 replicates is commonly used for standard error estimation, and 5,000 to 10,000 is often used for percentile or BCa interval endpoints, where Monte Carlo error in the tails matters more. With computationally intensive models, fewer replicates may be a practical compromise, but stability should then be checked by comparing interval endpoints across independent runs.
What if I have very few clusters?
With few clusters, the hierarchical bootstrap can be unreliable because there are too few distinct groups to resample. Cameron, Gelbach and Miller (2008) study inference in this setting. The wild cluster bootstrap is often considered as an alternative. It does not resample residuals; instead it multiplies each residual by a randomly drawn factor and adds the result to the fitted value to form a new dependent variable, which is then refitted. Its restrictions depend on the model and test, and it is not a drop-in replacement for every hierarchical model. There is no sharp cut-off for what counts as few clusters, so where the two approaches give different results, report both as a sensitivity check.
Can hierarchical bootstrap handle three or more levels?
Yes. Add a resampling step for each additional level, working from the highest level down. For example, with schools nested within districts nested within states, resample states, then schools within the selected states, then students within the selected schools. Each level of resampling propagates that level's uncertainty into the final bootstrap distribution.
Is hierarchical bootstrap a Bayesian method?
No. It is a frequentist resampling method that produces bootstrap standard errors and confidence intervals, not posterior credible intervals. It is grouped with Bayesian methods here only because it is often used alongside hierarchical Bayesian models as a frequentist check. Both approaches aim to propagate uncertainty correctly across the levels of a nested data structure.
Related methods
Sources
Davison, A. C. & Hinkley, D. V. (1997). Bootstrap Methods and their Application. Cambridge University Press.
ISBN: 978-0521574716Cameron, A. C., Gelbach, J. B. & Miller, D. L. (2008). Bootstrap-based improvements for inference with clustered errors. Review of Economics and Statistics, 90(3), 414-427.
Open DOI referencesandwich package documentation, vcovBS, p. 22