Choosing Inference for the Dependence Structure
Regression inference depends not only on the fitted equation but also on how observations may be dependent. If errors can move together within a school, firm, or other group, treating every observation as independent can understate uncertainty. If observations are ordered over time, serial dependence can create the same problem. The practical task is to identify the relevant independent sampling units, estimate uncertainty at the appropriate level, and use a reference distribution suited to the number and arrangement of those units.
The examples below compare four settings: unequal-sized independent clusters, few clusters, two-way dependence, and serially correlated errors. In every case, the regression coefficient is an ordinary least-squares estimate; what changes is the covariance estimator and the justification for the reference distribution.
Unequal Cluster Sizes: Use Cluster Scores
Suppose observations are partitioned into \(G\) clusters. A one-way cluster-robust covariance estimator allows arbitrary dependence among observations in the same cluster, while requiring clusters to be independent of one another. In a standard sandwich form, let \(X_g\) be the regressors for cluster \(g\), and let \(\hat{u}_g\) be its vector of fitted residuals. Then the uncorrected estimator is
The quantity \(X_g'\hat{u}_g\) is the cluster’s score contribution. Its outer product retains the within-cluster covariation that an observation-level heteroskedasticity-robust estimator would omit. Unequal cluster sizes require no separate averaging step: the regression design and residuals determine each cluster’s contribution.
A common finite-sample version multiplies this estimate by \( \frac{G}{G-1}\frac{n-1}{n-k} \), when these denominators are defined. This CR1 scaling is a convention, not a general solution to having very few clusters. In particular, it does not by itself make a normal reference distribution reliable when \(G\) is small.
Worked Example: Unequal Cluster Sizes in an Intercept-Only Regression
Consider a hypothetical outcome measured in three independent clusters of sizes 1, 2, and 4. Every observation in cluster 1 has outcome 2, every observation in cluster 2 has outcome 4, and every observation in cluster 3 has outcome 5. Fit an intercept-only regression, so \(k=1\).
The pooled mean, and hence the estimated intercept, weights observations rather than clusters: \( \hat{\beta}=(1(2)+2(4)+4(5))/7=30/7=4.286 \) outcome units. For an intercept-only model, the cluster score is the sum of residuals in that cluster. The three cluster scores are \( S_1=1(2-30/7)=-16/7 \), \( S_2=2(4-30/7)=-4/7 \), and \( S_3=4(5-30/7)=20/7 \). They sum to zero, as required by the fitted intercept.
Here \(X'X=n=7\), so the uncorrected variance estimate is \( \widehat{V}_{\mathrm{CR0}}=\sum_g S_g^2/7^2 \). Substituting, \( \widehat{V}_{\mathrm{CR0}}=[(256+16+400)/49]/49 =672/2401=0.2799 \) outcome units squared. Thus \( SE_{\mathrm{CR0}}=\sqrt{0.2799}=0.5291 \) outcome units.
The CR1 multiplier is \( [3/(3-1)][(7-1)/(7-1)]=1.5 \). It gives variance \(1.5(0.2799)=0.4199\) and standard error \( \sqrt{0.4199}=0.6480 \) outcome units. There are only three clusters, however. This calculation illustrates the covariance estimate and its scaling; it does not justify ordinary normal-based inference from three clusters.
Few Clusters: Adjust the Covariance and the Reference Distribution
With few independent clusters, cluster-robust standard errors can be downward biased, and normal or large-\(G\) approximations can be inaccurate. A careful analysis should examine cluster count, cluster leverage, and whether a small number of clusters dominate the coefficient of interest. CR2 adjusts cluster residual contributions for leverage under a working model with independent, homoskedastic errors across observations. That working model is used to calibrate the adjustment; the target inference can still allow cluster-level dependence.
CR2 does not supply a universal degrees-of-freedom correction. For a coefficient or contrast, Satterthwaite degrees of freedom approximate the sampling variation of the adjusted variance estimate. When the estimated variance can be represented approximately as a weighted sum of independent squared standard normal variables with nonnegative weights \( \lambda_1,\ldots,\lambda_m \), the corresponding degrees of freedom are
The resulting statistic is compared with a \(t\) distribution using these approximate degrees of freedom. A small \(df_{\mathrm{Satt}}\) reflects that the information for the particular contrast is concentrated in relatively few independent contributions—even if the total number of clusters is somewhat larger.
Worked Example: A CR2 Test With Few Clusters
Suppose a hypothetical regression has five independent clusters. For a coefficient measuring the change in an outcome in points per one-unit increase in a policy index, the estimate is \(0.80\) points per index unit. A CR2 calculation gives an estimated variance of \(0.54\) points squared. For this contrast, suppose the Satterthwaite calculation uses variance contributions \(0.04, 0.09, 0.16,\) and \(0.25\), whose sum is \(0.54\).
The approximate degrees of freedom are \( df_{\mathrm{Satt}}=0.54^2/(0.04^2+0.09^2+0.16^2+0.25^2) =0.2916/0.0978=2.982 \). The standard error is \( \sqrt{0.54}=0.7348 \) points per index unit. To test \(H_0:\beta=0\), the statistic is \( t=0.80/0.7348=1.089 \), compared with a \(t\) distribution with approximately 2.98 degrees of freedom.
The two-sided \(p\)-value is approximately \(0.36\), so this test does not reject \(H_0\) at the \(0.05\) significance level. The \(p\)-value is computed using the stated \(t\) reference distribution, not a standard normal distribution. It measures how often a statistic at least this far from zero would occur under the null and the approximation; it is not the probability that \(H_0\) is true.
Two-Way Dependence: Inclusion and Exclusion
Some regressions have two overlapping sources of dependence. For example, observations may be related within both firms and years. If there are many independent clusters in each dimension, the two-way cluster-robust covariance estimator combines the one-way estimates by inclusion-exclusion:
Here \(A\) and \(B\) identify the two clustering dimensions, and \(A\cap B\) identifies their intersections (such as firm-year cells). The intersection term is subtracted because dependence shared by both dimensions has otherwise been counted twice. Each component is formed from cluster-summed regression scores; finite-sample scaling can be applied to components according to the chosen implementation. This estimator relies on having a sufficiently informative number of clusters in each dimension. A large number of intersections cannot compensate for having only a handful of clusters in one dimension.
Worked Example: A Two-Way Clustered Contrast
In a hypothetical panel regression, researchers estimate a policy contrast in outcome points and cluster by firm and year. Suppose the contrast-specific variance components, calculated with the analysis’s stated finite-sample convention, are \( \widehat{V}_{\mathrm{firm}}=0.040 \), \( \widehat{V}_{\mathrm{year}}=0.030 \), and \( \widehat{V}_{\mathrm{firm}\cap\mathrm{year}}=0.018 \), all in points squared. The estimated contrast is \(0.45\) points.
Inclusion-exclusion gives \( \widehat{V}_{\mathrm{firm,year}}=0.040+0.030-0.018=0.052 \) points squared, so \( SE=\sqrt{0.052}=0.2280 \) points. The statistic for a zero contrast is \(0.45/0.2280=1.974\). If both dimensions have enough clusters for the usual large-cluster approximation, compare this statistic with a standard normal distribution; the two-sided \(p\)-value is approximately \(0.0484\).
This is an asymptotic calculation, not an exact finite-sample test. The conclusion depends on having adequate numbers of independent firms and years, not merely on the total number of firm-year observations. Also, a finite-sample multiway covariance estimate need not be positive semidefinite in every sample. A negative estimated variance for a particular contrast signals a problem with that estimate or its approximation; it is not a meaningful standard error.
Serial Dependence: HAC Inference
For observations ordered over time, heteroskedasticity-and-autocorrelation-consistent (HAC) covariance estimation allows a specified range of serial dependence while relying on a time-series asymptotic approximation. Let \(x_t\) be the row of regressors at time \(t\), \(\hat{u}_t\) its fitted residual, and \(\hat{g}_t=x_t'\hat{u}_t\) the score vector. A kernel HAC covariance estimate has the form
Here \(T\) is the number of time observations, \(L\) is the bandwidth, and \(w_\ell\) is the kernel weight at lag \(\ell\). For the Bartlett kernel, \(w_\ell=1-\ell/(L+1)\). The choice of kernel and bandwidth determines how much estimated serial covariance contributes. Valid large-sample inference requires appropriate time-series regularity, such as weak dependence and a bandwidth that grows suitably slowly with the sample size. HAC inference usually uses an asymptotic normal reference distribution; it is not a general exact small-sample \(t\) procedure.
Worked Example: A Bartlett HAC Test for a Regression Slope
Suppose a hypothetical time-series regression estimates a slope of \(0.12\) outcome units per one-unit increase in a regressor. In a sample of \(T=40\) time periods, the fitted score sequence for this slope has the following computed sums: \( \sum_t \hat{g}_t^2=40 \), \( \sum_{t=2}^{T}\hat{g}_t\hat{g}_{t-1}=12 \), and \( \sum_{t=3}^{T}\hat{g}_t\hat{g}_{t-2}=-6 \). Suppose also that the slope’s scalar design term is \(X'X=200\), and use a Bartlett bandwidth \(L=2\). These are hypothetical regression summaries, not results from a real study.
The Bartlett weights are \(w_1=1-1/3=2/3\) and \(w_2=1-2/3=1/3\). The HAC meat for this coefficient is \(40+2(2/3)(12)+2(1/3)(-6)=40+16-4=52\). Thus \( \widehat{V}_{\mathrm{HAC}}=52/200^2=0.001300 \) in squared slope units, and \( SE_{\mathrm{HAC}}=\sqrt{0.001300}=0.03606 \) outcome units per regressor unit.
For \(H_0:\beta=0\), the statistic is \(0.12/0.03606=3.328\). Under the stated large-sample normal approximation, the two-sided \(p\)-value is approximately \(0.0009\). This inference uses the specified lag window and time-series approximation. With only 40 periods, the approximation and bandwidth choice merit scrutiny; the calculation does not turn the statistic into an exact small-sample test.
A Practical Selection Sequence
The same regression output can support different inferences depending on the design. Before reporting a standard error or test, make the dependence structure explicit and check which asymptotic information is available.
For one-way clustering, observations may depend within a cluster but clusters must be independent. For two-way clustering, consider both dimensions. For a time series, dependence is indexed by temporal lag.
Use a cluster sandwich for within-cluster dependence, inclusion-exclusion for two clustering dimensions, or HAC for serial dependence. State any finite-sample correction, CR2 adjustment, kernel, and bandwidth used.
For many clusters, a normal approximation may be appropriate. With few clusters, consider CR2 and contrast-specific Satterthwaite degrees of freedom. HAC procedures generally use time-series asymptotics rather than a universal small-sample \(t\) correction.
Give the coefficient and its units, standard error or interval, covariance method, clustering dimensions or HAC settings, and reference distribution. Explain limitations such as few clusters in a dimension or a short time series.
Common Mistake: Treating a Correction as a Cure
A frequent error is to apply a finite-sample multiplier to a cluster-robust covariance estimate and then assume that the resulting standard error makes a normal test reliable with very few clusters. The multiplier adjusts scale; it does not create additional independent information or guarantee a suitable reference distribution. Few-cluster inference requires attention to leverage and degrees of freedom, such as CR2 with Satterthwaite inference when appropriate. Likewise, multiway clustering requires enough clusters in each dimension, and HAC methods require a defensible time-series approximation and bandwidth. A method should be chosen from the dependence structure and effective number of independent units—not from the largest available observation count.
Check Your Understanding
For each question, identify the covariance strategy and the main inferential qualification.
- A regression has highly unequal numbers of observations per school. Which feature of the cluster-robust estimator accounts for those differences?
- Why does multiplying a cluster covariance estimate by a CR1 finite-sample factor not, by itself, solve the problem of having very few clusters?
- In two-way clustering by firm and year, what does the intersection component represent, and why is it subtracted?
- A time-series analysis uses a Bartlett HAC estimator with bandwidth \(L=3\). What determines the weights on lag-one, lag-two, and lag-three covariance terms?
- What should an analyst check before relying on a normal reference distribution for a multiway-clustered test?