Cluster bootstrap
= Cluster bootstrap
A <cluster bootstrap> resamples entire observed groups, retaining all observations and their dependence within each selected group. The sampling unit is the group: draw $K$ group labels with replacement from the $K$ observed groups, concatenate their observations, and recompute the desired statistic. This is a form of <bootstrapping (statistics)> suited to independent groups whose internal observations need not be independent. The Stata manual implements it with cluster(); idcluster() distinguishes two resampled copies of the same original group when the fitted procedure needs group identifiers.<Bootstrap sampling and estimation in the Stata documentation>[Printed pp. 3–5, Options: size(), cluster(), idcluster(); printed p. 18, Technical note on unique panel identifiers]{ref}
For an original example, three sensors each supply two perfectly shared readings: $A=(0,0)$, $B=(2,2)$, and $C=(4,4)$. The overall <sample mean> is $2$. A cluster draw $(A,A,C)$ produces readings $(0,0,0,0,4,4)$ and <sample mean> $4/3$; the two copies of $A$ remain distinct resampling slots. Conditional on these data, the empirical <variance> of a group mean drawn uniformly from $0,2,4$ is $8/3$. Averaging three independent draws therefore gives bootstrap <variance>
$$
\operatorname{Var}_*(\overline X^*_{\rm cluster})=\frac{8/3}{3}=\frac89.
$$
Resampling six individual rows instead gives
$$
\operatorname{Var}_*(\overline X^*_{\rm row})=\frac{8/3}{6}=\frac49.
$$
The row procedure halves the conditional <variance> by pretending that two identical within-sensor readings are independent information. These fractions use the empirical drawing law directly, not a Bessel-corrected estimate of an unknown population <variance>.
With unequal group sizes, drawing the same number of groups can produce a different number of rows in each replicate. A pooled row mean and a mean of group means are different statistics: <unequal-cluster weighting in a cluster bootstrap> must follow the intended estimand. Many rows from a few sensors do not replace having many independent sensors; arbitrary dependence between sensors, a dominant group, or too few groups can defeat the intended inference.