Tutorials › Propensity Score Matching and Instrumental Variables › Cluster-Robust Anderson-Rubin Tests

Weak-Instrument Diagnostics · Tutorial 532 of 699

Cluster-Robust Anderson-Rubin Tests

Learn how to construct a cluster-robust Anderson–Rubin test and why its reliability depends on the number and structure of independent clusters.

Advanced 12 min read

What You'll Learn

  • Formulate the Anderson–Rubin null as a test of an instrument coefficient in a transformed outcome regression.
  • Compute the one-instrument cluster-robust variance from cluster score contributions.
  • Distinguish the chi-square large-cluster reference from small-sample t approximations.
  • Explain why weak instrument relevance does not invalidate the null test, but few clusters can.
  • Diagnose dependence structures and cluster configurations that make inference unreliable.
  • Compare cluster-robust inference with heteroskedasticity-robust and conventional Anderson–Rubin procedures.

Why Cluster Structure Changes Anderson–Rubin Inference

The Anderson–Rubin (AR) procedure tests a proposed value of an instrumental-variables coefficient without relying on the usual strong-first-stage approximation behind conventional IV Wald inference. When observations within a cluster may share shocks, however, treating them as independent can understate uncertainty. The AR test must use a variance estimate that allows arbitrary dependence within clusters, and its reference distribution must reflect how many independent clusters—not merely how many observations—support the inference.

Consider an outcome \(y_{ig}\), an endogenous regressor \(x_{ig}\), one excluded instrument \(z_{ig}\), and included exogenous covariates \(W_{ig}\), for observation \(i\) in cluster \(g\). The parameter of interest is \(\beta\). For a proposed value \(b\), the AR test transforms the outcome to \(y_{ig}-b x_{ig}\), then tests whether the excluded instrument predicts that transformed outcome after controlling for \(W_{ig}\). The focus here is the cluster-robust version with one excluded instrument.

Definition: The cluster-robust AR test of \(H_0:\beta=b\) fits the regression of \(y_{ig}-b x_{ig}\) on the included covariates \(W_{ig}\) and the excluded instrument \(z_{ig}\), then tests whether the coefficient on \(z_{ig}\) is zero using a variance estimator that aggregates score contributions by cluster. A cluster is assumed independent of other clusters; observations within a cluster may be dependent.

Model, Assumptions, and the Cluster Sandwich

A convenient structural model is

$$ y_{ig}=\beta x_{ig}+W_{ig}'\gamma+u_{ig}. $$

The instrument and included covariates must satisfy the relevant exogeneity and exclusion restrictions: under the null \(H_0:\beta=b\), the transformed error \(u_{ig}\) must have zero instrument moment after accounting for \(W_{ig}\). The instrument must be excluded from the structural outcome equation except through \(x_{ig}\). These conditions concern instrument validity; cluster-robust standard errors do not repair invalid instruments. Importantly, the AR test does not require the instrument to be strongly related to \(x_{ig}\) for its null test to have its weak-instrument-robust justification.

For cluster-based asymptotic inference, the independent sampling units are the clusters. A standard justification requires the number of independent clusters \(G\) to grow, no single cluster to dominate the relevant score variation, and suitable finite-moment and regularity conditions. Dependence within each cluster can otherwise be unrestricted. With a small \(G\), the cluster sandwich may be noisy and large-\(G\) reference distributions may be inaccurate.

Let \(\widehat\delta(b)\) be the coefficient on \(z\) in the transformed regression. To describe its cluster-robust variance, residualize \(z\) with respect to the included covariates, and denote the residuals by \(\tilde z_{ig}\). Let \(\hat e_{ig}\) be the residual from the full transformed regression, and define the cluster score contribution \(S_g=\sum_i \tilde z_{ig}\hat e_{ig}\). For the uncorrected cluster sandwich (often called CR0), the scalar variance estimate is

$$ \widehat{\operatorname{Var}}_{\mathrm{cl}}\{\widehat\delta(b)\} = \frac{\sum_{g=1}^{G} S_g^2} {\left(\sum_{g=1}^{G}\sum_i\tilde z_{ig}^{\,2}\right)^2}. $$

Finite-sample covariance corrections multiply this variance by a specified factor; different software may use different corrections. The correction should be reported, because it changes the standard error and test statistic. For clarity, the first two examples use the uncorrected formula.

Why the Test Works Under the Null

Under \(H_0:\beta=b\), the structural equation implies

$$ y_{ig}-b x_{ig}=W_{ig}'\gamma+u_{ig}. $$

Thus, after controlling for \(W_{ig}\), the population coefficient on \(z_{ig}\) in the transformed regression is zero if the instrument moment condition holds. The estimated coefficient is based on a sum of cluster-level score contributions. When independent clusters satisfy the stated large-\(G\) conditions, a cluster central limit argument gives an asymptotically normal coefficient estimate after scaling by its cluster-robust standard error. For one tested instrument coefficient, the squared statistic is therefore asymptotically chi-square with one degree of freedom:

$$ AR_{\mathrm{cl}}(b) = \frac{\widehat\delta(b)^2} {\widehat{\operatorname{Var}}_{\mathrm{cl}}\{\widehat\delta(b)\}} \ \overset{H_0}{\approx}\ \chi^2_1. $$

This is a large-cluster approximation, not an exact finite-sample result. With relatively few clusters, a commonly used alternative is to compare \(t_{\mathrm{cl}}=\widehat\delta(b)/SE_{\mathrm{cl}}\) with a \(t\) distribution using \(G-1\) degrees of freedom. That reference is a practical approximation, not a universal guarantee of correct size. Small-sample corrections or specialized methods may be warranted, and their validity depends on the design and assumptions.

Worked Example: Testing a Proposed Effect With Eight Clusters

Suppose a hypothetical study has \(G=8\) independent clinics and tests \(H_0:\beta=0.20\). The transformed regression gives \(\widehat\delta(0.20)=0.08\). For illustration, suppose the residualized-instrument sum of squares is \(\sum_{g,i}\tilde z_{ig}^{\,2}=8\), and the cluster score contributions satisfy \(\sum_g S_g^2=0.15\). Use the uncorrected cluster sandwich and a \(t_7\) reference as an illustrative small-sample approximation.

The cluster-robust variance is

$$ \widehat{\operatorname{Var}}_{\mathrm{cl}} = \frac{0.15}{8^2} = 0.00234375, \qquad SE_{\mathrm{cl}}=\sqrt{0.00234375}\approx0.04841. $$

The squared AR statistic, calculated directly from the unrounded variance, is

$$ AR_{\mathrm{cl}}(0.20) = \frac{0.08^2}{0.15/8^2} \approx 2.731. $$

Equivalently, the signed statistic is \(t_{\mathrm{cl}}=0.08/\sqrt{0.15/8^2}\approx1.652\). Against \(t_7\), the two-sided p-value is approximately \(0.1424\). At the 5% level, this approximation does not reject the proposed value \(\beta=0.20\). The p-value describes how unusual a statistic at least this extreme would be under the null and the stated reference approximation; it is not the probability that the null is true.

Worked Example: A Different Cluster Score Pattern

In a second hypothetical analysis, retain eight independent clusters and test \(H_0:\beta=b\). Suppose the transformed-regression coefficient is \(0.05\), the residualized-instrument sum of squares is \(8\), and the sum of squared cluster scores is \(0.075\). Again use the uncorrected sandwich and the illustrative \(t_7\) reference.

The variance and standard error are

$$ \widehat{\operatorname{Var}}_{\mathrm{cl}} = \frac{0.075}{8^2} = 0.001171875, \qquad SE_{\mathrm{cl}}=\sqrt{0.001171875}\approx0.03423. $$

Calculate the AR statistic from the variance, rather than squaring a rounded display of the \(t\) statistic:

$$ AR_{\mathrm{cl}}(b) = \frac{0.05^2}{0.075/8^2} \approx 2.133. $$

The corresponding signed statistic is approximately \(1.461\), below the two-sided 5% \(t_7\) critical value of about \(2.365\). The test therefore does not reject at that level. The smaller score variation here produces a smaller standard error than in the first example, but the effect estimate is also smaller; the decision must be based on their ratio, not on the standard error alone.

Cluster Counts, Diagnostics, and Alternatives

The number of observations \(N\) does not substitute for the number of independent clusters \(G\). A data set with thousands of patients in six hospitals still has only six independent hospital-level units for purposes of cluster-based asymptotics. When \(G\) is small, the sandwich variance can be downward biased, and the normal or chi-square approximation can have substantial size distortion. A \(t_{G-1}\) reference and a finite-sample covariance correction can help in some settings, but neither makes a very small number of clusters automatically reliable.

Cluster configuration matters as well. If a few clusters account for most of the instrument variation or score variation, the effective information may be concentrated in those clusters. Severe cluster-size imbalance, high-leverage clusters, or treatment or instrument variation occurring in only a handful of clusters are warning signs. Diagnostics should therefore include the number and sizes of clusters, the distribution of the instrument across clusters, and whether a small number of clusters dominate the cluster score contributions. A leave-one-cluster-out assessment can reveal sensitivity to individual clusters, but it is a diagnostic rather than a substitute for valid inference.

The relationship to other variance choices is direct:

ProcedureDependence representedMain caution
Conventional AR varianceUses the stipulated homoskedastic, independent-error modelCan be misleading when variance or dependence differs from that model
Heteroskedasticity-robust ARAllows observation-level heteroskedasticityDoes not account for within-cluster dependence
Cluster-robust ARAllows arbitrary dependence within clustersRequires enough independent clusters for reliable cluster-based inference

The cluster-robust procedure is appropriate when the sampling or assignment structure supports independence across clusters and within-cluster dependence is plausible. It is not appropriate merely because observations can be given cluster labels: the clusters must represent the relevant independent units. If dependence persists across clusters, or there are too few independent clusters for the chosen approximation, the reported p-value may not have its intended error rate. The cluster definition, covariance correction, reference distribution, and number of clusters should be stated alongside the result.

Common Mistake

A common error is to argue, “There are many individual observations, so the cluster-robust AR test has a large sample.” That reasoning counts correlated observations as if each supplied independent information. The correction is to identify the independent sampling units first and assess the approximation using the cluster count and cluster structure. Another error is to call cluster-robust standard errors weak-instrument proof: the AR transformation handles weak relevance for testing the null, but it still depends on instrument validity and credible cluster-level inference.

Key takeaway: With one excluded instrument, the cluster-robust AR test is a test of a zero instrument coefficient in the transformed regression, using cluster-aggregated score variation. Its weak-instrument robustness does not eliminate the need for valid instruments, independent clusters, or a defensible reference distribution.

Worked Example: Why the Number of Clusters Affects the Decision

Consider a hypothetical test whose estimated transformed-regression coefficient is \(0.11\) and whose cluster-robust standard error is \(0.05\). Thus \(t_{\mathrm{cl}}=0.11/0.05=2.20\) and \(AR_{\mathrm{cl}}=2.20^2=4.84\). Suppose the covariance estimate is held fixed solely to compare reference distributions.

If the data contain eight clusters, the illustrative \(t_7\) two-sided p-value is about \(0.064\), so the test does not reject at 5% using this reference. If there are forty clusters, a \(t_{39}\) reference gives a two-sided p-value of about \(0.034\), which is below 5%. The differing decisions illustrate why the reference distribution depends on cluster count. They do not show that one can choose whichever reference gives the preferred answer: the actual cluster design and a justified inference method determine the reference.

Check Your Understanding

Use the definitions and distinctions above to answer these questions. Solutions follow each problem.

  1. Under \(H_0:\beta=b\), what coefficient is tested in the AR regression? Solution: Regress \(y-bx\) on the included covariates and the excluded instrument, then test that the instrument coefficient is zero.
  2. In a hypothetical one-instrument test, \(\widehat\delta=0.06\) and \(\widehat{\operatorname{Var}}_{\mathrm{cl}}=0.0009\). Compute the AR statistic. Solution: \(AR=0.06^2/0.0009=0.0036/0.0009=4.00\).
  3. Why can a study with many individuals still have unreliable cluster-based inference? Solution: If those individuals are concentrated in few independent clusters, the large-cluster approximation may be poor; the relevant independent-unit count is \(G\), not just the individual sample size.
  4. Does a weak instrument invalidate the AR test, and does cluster robustness validate an invalid instrument? Solution: Weak relevance alone does not invalidate the AR null test. Cluster-robust covariance estimation addresses within-cluster dependence, not failures of instrument exogeneity or exclusion.
  5. What does a cluster score diagnostic reveal? Solution: It can identify whether a small number of clusters contribute disproportionately to the sandwich variance, signaling sensitivity or concentration of information; it does not by itself establish that the reference distribution is valid.
Clinical Biostats