---
title: 'Cluster Jackknife: Resampling & Variance Estimation'
url: https://www.emergentmind.com/topics/cluster-jackknife
type: topic
---

# Cluster Jackknife: Resampling & Variance Estimation

Cluster jackknife is a family of resampling, variance-estimation, and diagnostic procedures that treats the cluster—not the individual observation—as the operative unit of deletion. In clustered regression models, its canonical form is the delete-one-cluster jackknife that generates leave-one-cluster-out estimates and uses their dispersion to construct cluster-robust variance estimators such as CV\(_3\) and CV\(_{3\mathrm J}\) [2205.03288]. In the broader literature, the same logic is adapted to settings in which the relevant unit is a spatial block, a treatment-assignment cluster, a background source in strong lensing, or even a synthetic subsample used as a computational device for massive data [2109.07071][2505.00553][2304.06231].

## 1. Cluster as the Fundamental Unit

In the standard clustered linear regression setup, there are \(G\) disjoint clusters indexed by \(g=1,\dots,G\), with cluster \(g\) containing \(N_g\) observations and total sample size \(N=\sum_{g=1}^G N_g\). The model is written at the cluster level as
\[
y_g = X_g \beta + u_g,\qquad g=1,\ldots,G,
\]
and OLS takes the stacked form
\[
\hat\beta = (X'X)^{-1}X'y
          = \Big(\sum_{g=1}^G X_g'X_g\Big)^{-1}\sum_{g=1}^G X_g'u_g.
\]
A central object is the cluster score
\[
s_g = X_g'u_g,
\]
so that the distribution of \(\hat\beta\) depends on disturbances only through the cluster scores. Under correct specification and cluster independence,
\[
\Var(\hat\beta) = (X'X)^{-1}\Big(\sum_{g=1}^G \Sigma_g\Big)(X'X)^{-1}.
\]

This formulation makes the conceptual point that under clustered dependence the effective observational unit for inference is the cluster. The same perspective motivates cluster-level leverage, partial leverage, and influence diagnostics. Cluster leverage is defined as
\[
L_g = \mathrm{Tr}(H_{gg})
    = \mathrm{Tr}\!\big(X_g'X_g(X'X)^{-1}\big),
\]
where \(H_{gg}\) is the \(g\)-th diagonal block of the hat matrix. Its average is \(k/G\), since \(\sum_{g=1}^G L_g = k\). For a coefficient \(\beta_j\), cluster partial leverage is
\[
L_{gj} = \frac{\acute x_{gj}'\acute x_{gj}}{\acute x_j'\acute x_j},
\]
so \(\sum_{g=1}^G L_{gj}=1\) and the average is \(1/G\). High \(L_g\) or \(L_{gj}\) indicates that a cluster has unusually large potential influence on fitted values or on the coefficient of interest. Realized influence is then examined through the delete-one-cluster estimator
\[
\hat\beta^{(g)} = \big(X'X - X_g'X_g\big)^{-1}\big(X'y - X_g'y_g\big),
\]
with large deviations \(\hat\beta_j^{(g)}-\hat\beta_j\) signaling that results are sensitive to cluster \(g\) [2205.03288].

## 2. Jackknife Variance Estimators

The conventional Liang–Zeger style cluster-robust variance estimator, denoted CV\(_1\), is
\[
\widehat{\Var}(\hat\beta)
= \frac{G(N-1)}{(G-1)(N-k)}
(X'X)^{-1}
\Big(\sum_{g=1}^G \hat s_g \hat s_g'\Big)
(X'X)^{-1},
\]
where \(\hat s_g = X_g'\hat u_g\). CV\(_1\) is a sandwich estimator, not a jackknife estimator.

The cluster jackknife estimator CV\(_3\) replaces raw empirical scores with leave-one-cluster variability:
\[
\mathrm{CV}_3:\quad
\widehat{\Var}(\hat\beta)
= \frac{G-1}{G}
\sum_{g=1}^G
\big(\hat\beta^{(g)}-\hat\beta\big)
\big(\hat\beta^{(g)}-\hat\beta\big)'.
\]
An equivalent score-based expression is
\[
\mathrm{CV}_3:\quad
\widehat{\Var}(\hat\beta)
= \frac{G-1}{G}(X'X)^{-1}
\Big(\sum_{g=1}^G \ddot s_g\ddot s_g'\Big)
(X'X)^{-1},
\]
where \(\ddot s_g = X_g'M_{gg}^{-1}\hat u_g\) and \(M_{gg}\) is the \(g\)-th block of the residual-maker \(M=I-H\). A closely related estimator is
\[
\mathrm{CV}_{3\mathrm J}:\quad
\widehat{\Var}(\hat\beta)
= \frac{G-1}{G}
\sum_{g=1}^G
\big(\hat\beta^{(g)}-\bar\beta\big)
\big(\hat\beta^{(g)}-\bar\beta\big)',
\qquad
\bar\beta = \frac1G\sum_{g=1}^G \hat\beta^{(g)}.
\]

The distinction between CV\(_3\) and CV\(_{3\mathrm J}\) is only the centering point, \(\hat\beta\) versus \(\bar\beta\). Their difference is positive semidefinite, so CV\(_3\) is weakly more conservative. In finite samples, both are generally more conservative than CV\(_1\), and the simulations summarized in the literature report lower rejection frequencies for CV\(_3\) and CV\(_{3\mathrm J}\), especially when clusters are heterogeneous or \(G\) is modest. The same literature also emphasizes that CV\(_3\) is the cluster analogue of HC\(_3\), while CV\(_1\) plays the role of a simple sandwich estimator [2205.03288].

## 3. Computation and Software

A naive implementation of cluster jackknife would re-estimate the model \(G\) times. The computational advance in the modern literature is to exploit cluster sufficient statistics,
\[
X_g'X_g,\qquad X_g'y_g,
\]
so that once \(X'X=\sum_g X_g'X_g\) and \(X'y=\sum_g X_g'y_g\) are available, each leave-one-cluster estimate requires only a \(k\times k\) subtraction, a \(k\times 1\) subtraction, one inversion of a \(k\times k\) matrix, and one matrix–vector multiplication. Cluster leverage is likewise computed from
\[
L_g=\mathrm{Tr}\!\big(X_g'X_g(X'X)^{-1}\big),
\]
without forming the full \(N\times N\) hat matrix. The same computations deliver influence measures, CV\(_3\), and CV\(_{3\mathrm J}\). The paper emphasizes that computing CV\(_3\) as a jackknife is simpler and usually faster than computing it via cluster-specific inverses of \(M_{gg}\) [2205.03288].

| Context | Software | Reported functionality |
|---|---|---|
| Linear regression with clustered disturbances | `summclust` | Computes \(N_g\), \(L_g\), \(L_{gj}\), \(\hat\beta_j^{(g)}\), CV\(_1\), CV\(_3\), and CV\(_{3\mathrm J}\) |
| Staggered-adoption DiD / CSDID | `csdidjack`, `didjack` | Computes cluster-jackknife standard errors for aggregated ATT |
| Logistic regression | `logitjack` | Reports CV\(_1\), CV\(_3\)L, optionally CV\(_3\), and WCLR/WCLU procedures |
| Two-way clustered linear regression | `twowayjack` | Reports CV\(_1^{(\max)}\) and CV\(_3^{(\max)}\) for scalar hypotheses |

In nonlinear and multiway settings, full delete-one-cluster re-estimation can be expensive. For clustered logit, a linearized cluster-jackknife variance estimator CV\(_3\)L replaces exact leave-one-cluster maximum-likelihood estimates by first-order approximations based on cluster scores and Hessians, and the simulations report that CV\(_3\)L is usually very close to CV\(_3\) while being much cheaper to compute [2406.00650]. For two-way clustering, `twowayjack` implements a three-component cluster-jackknife construction and a max-se rule that always yields defined scalar tests, while `csdidjack` and `didjack` apply leave-one-cluster-out recomputation to the aggregated ATT in Callaway–Sant’Anna Difference-in-Differences estimation [2406.08880][2602.12043].

## 4. Generalizations in Econometrics

In staggered-adoption DiD, the cluster jackknife is applied to the aggregated CSDID estimator. If \(\widehat{ATT}\) denotes the full-sample aggregated ATT and \(\widehat{ATT}^{(h)}\) is the estimate obtained after omitting cluster \(h\), the proposed CV\(_3\) variance is
\[
\widehat{\Var}_{\text{CV}_3}(\widehat{ATT})
= \frac{H-1}{H}\sum_{h=1}^H
\left(\widehat{ATT}^{(h)}-\widehat{ATT}\right)^2.
\]
The simulation evidence in that paper shows that default asymptotic and multiplier-bootstrap inference can reject a true null far too often when clusters or treated clusters are few, whereas the cluster jackknife greatly improves inference [2602.12043].

For clustered logistic regression, the exact cluster jackknife is defined by recomputing the logit estimator \(G\) times, once per omitted cluster, and using
\[
\widehat{\Var}_{\text{CV3}(\hat\beta)}
= \frac{G-1}{G}\sum_{g=1}^G
(\hat\beta^{(g)}-\hat\beta)(\hat\beta^{(g)}-\hat\beta)'.
\]
Because that can be computationally demanding, the paper develops the linearized estimator CV\(_3\)L and linearized wild cluster bootstrap procedures WCLR and WCLU, including score-transformed variants. The simulation results strongly favor the new methods over the conventional cluster-robust variance estimator [2406.00650].

With two-way clustering, the jackknife construction is extended componentwise. Leave-one-\(g\)-out, leave-one-\(h\)-out, and leave-one-intersection-out estimators produce
\[
\widehat V_G^{\mathrm{JK}},\qquad
\widehat V_H^{\mathrm{JK}},\qquad
\widehat V_I^{\mathrm{JK}},
\]
which are combined as
\[
\widehat V_3^{(3)}
=
\widehat V_G^{\mathrm{JK}}
+
\widehat V_H^{\mathrm{JK}}
-
\widehat V_I^{\mathrm{JK}}.
\]
Because conventional two-way CRVEs can be indefinite, the paper also proposes a max-se rule, and its simulations recommend CV\(_3^{(\max)}\) as the preferred choice [2406.08880].

In judge designs with multidimensional clustering, cluster jackknife refers to modifying the IV projection matrix so that all entries corresponding to within-cluster dependence vanish. The multidimensional cluster jackknife IV estimator uses
\[
\dddot P_Z
=
P_Z
-
B_{P_Z}^{(1)}
-
B_{P_Z}^{(2)}
+
B_{P_Z}^{(1,2)},
\]
and then
\[
\hat{\beta}_{MDCJ} = (X'\dddot P_Z X)^{-1} X'\dddot P_Z y.
\]
The paper’s Monte Carlo evidence shows that this multidimensional cluster jackknife can be essentially unbiased when clustering is complex and spans multiple dimensions [2406.09473].

## 5. Variants Outside Classical Clustered Regression

In large-data analysis with limited computational resources, the cluster jackknife can be synthetic rather than intrinsic. The proposed Jackknife Debiased Subsample estimator treats each subsample as a cluster, applies a delete-1 jackknife within each subsample, and averages the debiased cluster-level estimates:
\[
\widehat{\theta}_{\text{JDS}}
=
\frac{1}{K}\sum_{k=1}^K
\widehat{\theta}^{(k)}_{\text{JDS}}.
\]
The paper shows that jackknife debiasing reduces the leading subsampling bias from \(O(1/n)\) to \(O(1/n^2)\), while the asymptotic variance remains of order \(\tau_1(1/(nK)+1/N)\) [2304.06231].

In strong-lensing mass modeling, the omitted unit is not an econometric cluster but an entire background source. The jackknife procedure removes all images of one source, re-optimizes the mass model on the remaining sources, predicts the omitted images, and evaluates residuals
\[
\Delta x_j = x_j^{\rm obs} - x_j^{\rm pred},\qquad
\Delta y_j = y_j^{\rm obs} - y_j^{\rm pred}.
\]
The normalized residuals \(\Delta x_j/\sigma_{\rm eff}\) and \(\Delta y_j/\sigma_{\rm eff}\) form a “Jackknife distribution” that is used to validate the predictive adequacy of the mass model rather than to estimate the variance of the target cosmological parameter directly [2505.00553]. In the Refsdal analysis, the same source-based jackknife is used to test whether normalized residuals are close to \(\mathcal N(0,1)\); the authors report \(\sigma_{J_4}\) values of \(1.027\), \(1.156\), \(1.163\), and \(1.286\) across four mass models, and use these diagnostics to support the robustness of the final \(H_0\) constraint [2509.09979].

For covariance estimation of the two-point correlation function, delete-one jackknife over spatial subvolumes must account for auto-pairs and cross-pairs. One paper derives pair-weighting corrections and a “match” scheme, and reports that corrected internal resampling recovers the amplitude and structure of the covariance matrix, as represented by its principal components, to within \(\sim 10\%\) in 1000 QUIJOTE simulations [2109.07071]. A related “jackknife on mocks” approach estimates a covariance within each mock by delete-\(d\) jackknife over spatial sub-volumes and then averages across mocks; in the BOSS DR11 application it yields similar galaxy-clustering covariance estimates while requiring \(\sim 7\) times fewer simulations to get similar accuracy on variance [1606.00233].

## 6. Interpretation, Diagnostics, and Limitations

A recurrent theme in the literature is that cluster jackknife is not merely a more conservative replacement for CV\(_1\); it is also a diagnostic framework. High cluster leverage \(L_g\), high partial leverage \(L_{gj}\), and large deviations of \(\hat\beta_j^{(g)}\) from \(\hat\beta_j\) identify clusters that dominate identification or instability. The scaled variance
\[
V_s(L_{\bullet j})
=
\frac{1}{(G-1)\bar L_j^2}\sum_{g=1}^G (L_{gj}-\bar L_j)^2,
\qquad
\bar L_j = 1/G,
\]
is reported to be particularly predictive of size distortions in cluster-robust tests, with CV\(_1\) the most sensitive. The empirical guidance is to compare CV\(_3\) and CV\(_1\): if they are close and leverage diagnostics are mild, CV\(_1\) is probably fine; if they differ substantially and leverage heterogeneity is large, prefer CV\(_3\) or bootstrap methods [2205.03288].

The method also has failure modes. Omit-one-cluster samples can be singular, especially in one-sided designs such as a regressor that is nonzero in only one cluster. In those cases software may use a generalized inverse, may set some coefficients to 0, or may report versions of CV\(_3\) and CV\(_{3\mathrm J}\) that drop singular omit-one-cluster subsamples. In nonlinear models, delete-one-cluster estimation can fail because of perfect separation, and in two-way clustering the three-term variance matrix can be indefinite even before any jackknife correction. These are not secondary implementation issues; they are informative about the fragility of the design [2205.03288].

A broader theoretical caution comes from general jackknife theory. In a cluster/block interpretation, the delete-\(d\) choice is not innocuous: the paper on jackknife, bootstrap, and Taylor-series bias correction argues that bounded coefficients are essential, while delete-1 \(r\)-jackknife can exhibit drastically different, and in worst cases exploding, bias and variance behavior. This suggests caution in extending cluster jackknife to aggressive higher-order delete-\(d\) schemes without checking the implied weights [1709.06183].

Taken together, the literature treats cluster jackknife less as a single estimator than as a design principle: delete the unit that carries the relevant dependence, identification, or predictive structure, and use the resulting leave-one-unit-out variation either to estimate uncertainty or to test robustness. This suggests that the method is most informative when the omitted unit coincides with the substantive unit at which the inferential problem is actually generated.

Source: https://www.emergentmind.com/topics/cluster-jackknife