betaFeedback

WorksEconomics, Econometrics and Finance

Uniform Inference for Two-Way Clustered Data

Abstract

We establish uniformly asymptotically exact inference for the population mean of two-way clustered data, allowing the data-generating process to vary with sample size. This finding does not contradict the well-known impossibility result of Menzel (2021), which places a fundamental limit on uniform estimation of the asymptotic distribution of the normalized full-array mean. We estimate the same population mean by averaging the sample means from random matchings. A closed-form standard error makes the resulting confidence interval straightforward to implement. The variance estimator is positive semidefinite and the studentized matching estimator is uniformly asymptotically standard normal. The cost of uniform validity is a slower convergence rate under degeneracy. We extend the result to smooth functions of GMM parameters, allowing the different moment components to exhibit different dependence regimes. In simulations, the proposed confidence intervals achieve coverage close to the nominal level across the dependence regimes considered.

JEL Classification: C12, C13, C14.

Introduction

Two-way clustering is widely used in empirical economics to account for dependence among observations that share a cluster in either of two dimensions. In a firm panel, for example, outcomes may be correlated both within a firm over time and across firms in the same period. The conventional approach estimates a parameter from the full array and adjusts its standard error for dependence within rows and columns [3]. Even for the sample mean, however, the dependence structure can affect the form of the limiting distribution. When row or column effects dominate, the normalized full-array mean typically has a Gaussian limit. As these effects weaken, interactions between rows and columns can produce a non-Gaussian limit. Menzel [24] shows that the limiting law of the normalized full-array mean cannot be estimated uniformly consistently over such sequences. We approach the inference problem by constructing a different estimator of the same population mean, for which Gaussian critical values are uniformly valid.

Our estimator averages the means obtained from repeated random matchings. Taking the dimension with fewer clusters as the rows, each matching assigns a distinct column to every row, uniformly at random and independently of the data. No two selected observations share a row or a column. Under separately exchangeable, dissociated sampling, they therefore form an i.i.d. sample from the marginal distribution. A single matching permits conventional inference for the population mean but uses only one observation per row. Additional matchings recover precision: conditional on the observed array, their means are independent and centered at the full-array mean. The choice of how many matchings to use matters because averaging too many can cause the estimator to inherit the non-Gaussian limit of the full-array mean.

We make four contributions. First, we characterize the limiting distribution of the matching estimator as the number of matchings varies. An exact variance decomposition separates the sampling variance of the full-array mean from the additional variance due to matching. Increasing the number of matchings improves precision, but it can also give the full-array error enough weight to produce a non-Gaussian limit. This trade-off motivates letting the number of matchings grow more slowly than the smaller cluster count to recover precision while retaining a Gaussian limit across dependence regimes.

Second, we provide a closed-form variance estimator that makes the confidence interval straightforward to compute. It combines estimates of row, column, and intersection variation with nonnegative weights. The estimate is positive semidefinite in every sample by construction. Inference then requires only the estimated standard error and a standard normal critical value, without a bootstrap or a preliminary test of the dependence regime.

Third, we establish uniformly asymptotically exact inference for the population mean. Under our moment conditions, the studentized matching estimator admits a uniform standard normal approximation whenever the number of matchings is fixed or grows at any rate slower than the smaller cluster count. If the number of matchings grows more slowly than the square root of that count, a uniform bound on the standardized fourth moment suffices for the same conclusion. The approximation holds uniformly over sequences of data-generating processes that may vary with sample size. The strength of clustering in either dimension need not converge, and the two cluster counts may grow at different rates.

Fourth, we extend the procedure to smooth functions of generalized method of moments (GMM) parameters, including regression coefficients. Under two-way clustering, different moments can converge at different rates. Estimation error in a slowly converging coefficient can then enter the limiting distribution of a faster one through a quadratic term (Davezies et al. [13], Section 3). We show that the same restriction on the number of matchings makes this term negligible relative to the standard error of the target. Applying the variance estimator to the estimated influence function therefore gives uniformly asymptotically exact inference even when the moment components follow different dependence regimes.

Our analysis complements the literature on inference based on the full array. Davezies et al. [12] develop empirical process theory for exchangeable arrays, and Chiang and Sasaki [11] give conditions under which conventional two-way standard errors yield valid Gaussian inference. MacKinnon et al. [23] study wild bootstrap inference for regression, while Chiang, Matsushita, and Otsu (2025) construct an empirical likelihood statistic using estimates that leave out rows or columns. Davezies et al. [13] develop analytic tests that control size uniformly over their class. Their tests are asymptotically exact in Gaussian regimes and can be conservative in non-Gaussian regimes. By changing the estimator, we obtain exact asymptotic coverage even for laws under which the full-array mean has a non-Gaussian limit, at a cost in precision that we quantify.

Menzel [24] shows that, when the observation pattern is independent of the data, observing only a vanishing fraction of intersections can yield a Gaussian limit for the sample mean. Chiang, Li, and Sasaki [9] establish asymptotic normality under Bernoulli subsampling for each fixed data-generating process. We select intersections by repeated matching and establish asymptotically exact coverage uniformly over laws in which row and column effects may weaken or vanish as the sample size grows. The role of the number of sampled terms in determining the limiting distribution also arises in the theory of incomplete UU-statistics [19, 6].

Section 2 introduces the two-way clustering framework and describes how the dependence structure affects the limiting distribution of the full-array mean. Section 3 presents the matching estimator, shows how the number of matchings affects its precision and limiting distribution, and establishes uniformly asymptotically exact coverage for the resulting interval. Section 4 extends the results to smooth functions of GMM parameters. Section 5 reports Monte Carlo evidence on confidence interval coverage and length. Section 6 concludes. The appendix contains the proofs.

Two-way clustering

Sampling framework

We observe a complete array YNT={YNT,it:1≤i≤N,1≤t≤T}Y_{NT} = \{Y_{NT,it} : 1 \le i \le N, 1 \le t \le T\}. Label the smaller dimension as the rows, so that 2≤N≤T2 \le N \le T, and let N,T→∞N, T \to\infty jointly.

Assumption 1 (Two-way clustered sampling). At each (N,T)(N,T), the observations admit the representation

YNT,it=fNT(ξi,ηt,ζit).(1)Y_{NT,it}=f_{NT}(\xi_i,\eta_t,\zeta_{it}). \tag*{(1)}

The row shocks {ξi}\{\xi_i\}, column shocks {ηt}\{\eta_t\}, and intersection shocks {ζit}\{\zeta_{it}\} form three mutually independent families, with i.i.d. shocks within each family. The marginal mean is θNT=E[YNT,it]\theta_{NT}=E[Y_{NT,it}], and the marginal variance satisfies σNT2=Var⁡(YNT,it)∈(0,∞)\sigma^2_{NT}=\operatorname{Var}(Y_{NT,it})\in(0,\infty).

Equation (1) is the Aldous-Hoover-Kallenberg representation for a separately exchangeable, dissociated array [1, 16, 22]. Observations may be dependent within a row or column, while collections of observations with disjoint row and column indices are independent. Allowing fNTf_{NT} to vary with (N,T)(N,T) permits both the marginal distribution and the strength of clustering to change with sample size. For related work on multiway clustering, see, e.g., (Davezies et al. 2021, 2025; Menzel 2021; Chiang et al. 2023, 2024; Graham et al. 2024; Chen and Vogelsang 2024; Hounyo and Lin 2026a,b; Juodis 2026; Jochmans 2026).

To describe how each shared shock affects the conditional mean, define the row projection and column projection by

aNT,i=E[YNT,it∣ξi]−θNT,bNT,t=E[YNT,it∣ηt]−θNT.a_{NT,i}=E[Y_{NT,it}\mid\xi_i]-\theta_{NT},\qquad b_{NT,t}=E[Y_{NT,it}\mid\eta_t]-\theta_{NT}.

The remaining variation is the intersection residual rNT,itr_{NT,it}, giving the following decomposition

YNT,it−θNT=aNT,i+bNT,t+rNT,it.(2)Y_{NT,it}-\theta_{NT}=a_{NT,i}+b_{NT,t}+r_{NT,it}. \tag*{(2)}

All three components are centered and mutually uncorrelated. The intersection residual satisfies E[rNT,it∣ξi]=E[rNT,it∣ηt]=0E[r_{NT,it}\mid\xi_i]=E[r_{NT,it}\mid\eta_t]=0, although it can still depend on the interaction between ξi\xi_i and ηt\eta_t. Distinct intersection residuals are uncorrelated.

Averaging (2) gives the corresponding decomposition of the full-array mean YˉNT=\bar{Y}_{NT}=

(NT)−1∑i,tYNT,it,(NT)^{-1}\sum_{i,t}Y_{NT,it},
YˉNT−θNT=1N∑i=1NaNT,i+1T∑t=1TbNT,t+1NT∑i=1N∑t=1TrNT,it.\bar{Y}_{NT}-\theta_{NT}=\frac{1}{N}\sum_{i=1}^{N}a_{NT,i}+\frac{1}{T}\sum_{t=1}^{T}b_{NT,t}+\frac{1}{NT}\sum_{i=1}^{N}\sum_{t=1}^{T}r_{NT,it}.

Let σNT,R2=E[aNT,i2]\sigma^{2}_{NT,R}=E[a^{2}_{NT,i}], σNT,C2=E[bNT,t2]\sigma^{2}_{NT,C}=E[b^{2}_{NT,t}], and σNT,I2=E[rNT,it2]\sigma^{2}_{NT,I}=E[r^{2}_{NT,it}], where the subscripts R, C, and I denote the row, column, and intersection components, respectively. By orthogonality,

σNT2=σNT,R2+σNT,C2+σNT,I2,VNT,F=Var⁡(YˉNT)=σNT,R2N+σNT,C2T+σNT,I2NT.(3)\sigma^{2}_{NT}=\sigma^{2}_{NT,R}+\sigma^{2}_{NT,C}+\sigma^{2}_{NT,I},\qquad V_{NT,F}=\operatorname{Var}(\bar{Y}_{NT})=\frac{\sigma^{2}_{NT,R}}{N}+\frac{\sigma^{2}_{NT,C}}{T}+\frac{\sigma^{2}_{NT,I}}{NT}. \tag*{(3)}

Limiting distributions across dependence regimes

By (3), the row and column projections account for the following share of the variance of the full-array mean:

νNT=σNT,R2/N+σNT,C2/TVNT,F,1−νNT=σNT,I2/(NT)VNT,F.(4)\nu_{NT}=\frac{\sigma^{2}_{NT,R}/N+\sigma^{2}_{NT,C}/T}{V_{NT,F}},\qquad1-\nu_{NT}=\frac{\sigma^{2}_{NT,I}/(NT)}{V_{NT,F}}. \tag*{(4)}

We call a sequence nondegenerate if νNT→1\nu_{NT}\to1: the projection averages dominate and have a Gaussian limit after standardization under the Lindeberg condition for their sum. In the degenerate case, νNT→0\nu_{NT}\to0 and the intersection term dominates. Exact degeneracy, where σNT,R2=σNT,C2=0\sigma^{2}_{NT,R}=\sigma^{2}_{NT,C}=0 at every sample size, is a special case. In the intermediate case, νNT→c∈(0,1)\nu_{NT}\to c\in(0,1): both terms contribute to the variance. These cases describe the full-array mean; our uniform inference result does not require νNT\nu_{NT} to converge.

Even under exact degeneracy, the limiting law can be Gaussian or non-Gaussian. Consider two designs with θNT=0\theta_{NT}=0 and σNT,I2=σNT2=1\sigma^{2}_{NT,I}=\sigma^{2}_{NT}=1, so that VNT,F=1/(NT)V_{NT,F}=1/(NT) in both. For YNT,it=ζitY_{NT,it}=\zeta_{it}, with ζit\zeta_{it} standard normal distributed, NTYˉNT\sqrt{NT}\bar{Y}_{NT} is standard normal. For YNT,it=ξiηtY_{NT,it}=\xi_i\eta_t with mutually independent standard normal row and column shocks, YˉNT\bar{Y}_{NT} is the product of the two shock averages. Hence

NTYˉNT=(NξˉN)(TηˉT)=dZ1Z2,\sqrt{NT}\bar{Y}_{NT}=(\sqrt{N}\bar{\xi}_{N})(\sqrt{T}\bar{\eta}_{T})\mathrel{\overset{d}{=}} Z_{1}Z_{2},

where Z1Z_1 and Z2Z_2 are independent standard normals.

A local shift moves the product design into the intermediate regime. Let

YNT,it=ξi(ηt+δ/T).(5)Y_{NT,it} = \xi_i(\eta_t + \delta/\sqrt{T}). \tag*{(5)}

For fixed δ≠0\delta\ne0, aNT,i=δξi/Ta_{NT,i} = \delta\xi_i/\sqrt{T}, bNT,t=0b_{NT,t} = 0, and rNT,it=ξiηtr_{NT,it} = \xi_i\eta_t. Although σNT,R2=δ2/T→0\sigma^2_{NT,R} = \delta^2/T \to0, the row projection contributes δ2/(NT)\delta^2/(NT) to VNT,FV_{NT,F}, compared with 1/(NT)1/(NT) from the intersection residual. Thus νNT=δ2/(1+δ2)\nu_{NT} = \delta^2/(1+\delta^2), and

References

  1. [1]Aldous, D. J. (1981). Representations for partially exchangeable arrays of random variables. Journal of Multivariate Analysis 11(4), 581–598.DOI
  2. [2]Bentkus, V. and F. Götze (1996). The Berry–Esseen bound for Student’s statistic. Annals of Probability 24(1), 491–503.DOI
  3. [3]Cameron, A. C., J. B. Gelbach, and D. L. Miller (2011). Robust inference with multiway clustering. Journal of Business & Economic Statistics 29(2), 238–249.DOI
  4. [5]Chen, L. H. Y. and X. Fang (2015). On the error bound in a combinatorial central limit theorem. Bernoulli 21(1), 335–359.
  5. [6]Chen, X. and K. Kato (2019). Randomized incomplete U-statistics in high dimensions. Annals of Statistics 47(6), 3127–3156.arxiv.org/abs/1712.00771
  6. [7]Chiang, H. D., B. E. Hansen, and Y. Sasaki (2024). Standard Errors for Two-Way Clustering with Serially Correlated Time Effects. The Review of Economics and Statistics, 1–40.arxiv.org/abs/2201.11304
  7. [9]Chiang, H. D., J. Li, and Y. Sasaki (2025). Algorithmic subsampling under multiway clustering. Econometric Theory 41(1), 79–122.
  8. [11]Chiang, H. D. and Y. Sasaki (2023). On using the two-way cluster-robust standard errors. arXiv preprint arXiv:2301.13775.arxiv.org/abs/2301.13775
  9. [12]Davezies, L., X. D’Haultfœuille, and Y. Guyonvarch (2021). Empirical process results for exchangeable arrays. Annals of Statistics 49(2), 845–862.DOI
  10. [13]Davezies, L., X. D’Haultfœuille, and Y. Guyonvarch (2025). Analytic inference with two-way clustering. arXiv:2506.20749. Revised February 2026.arxiv.org/abs/2506.20749
  11. [15]Hansen, L. P. (1982). Large sample properties of generalized method of moments estimators. Econometrica 50(4), 1029–1054.DOI
  12. [16]Hoover, D. N. (1979). Relations on probability spaces and arrays of random variables. Unpublished manuscript, Institute for Advanced Study.
  13. [19]Janson, S. (1984). The asymptotic distributions of incomplete U-statistics. Zeitschrift für Wahrscheinlichkeitstheorie und Verwandte Gebiete 66(4), 495–505.DOI
  14. [22]Kallenberg, O. (1989). On the representation theorem for exchangeable arrays. Journal of Multivariate Analysis 30(1), 137–154.DOI
  15. [23]MacKinnon, J. G., M. Ø. Nielsen, and M. D. Webb (2021). Wild bootstrap and asymptotic inference with multiway clustering. Journal of Business & Economic Statistics 39(2), 505–519.
  16. [24]Menzel, K. (2021). Bootstrap with cluster-dependence in two or more dimensions. Econometrica 89(5), 2143–2188.DOI

Paper details

vlnc:W_fz3c2tkz
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC0-1.0
Usage

views · 3

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Economics, Econometrics and Finance

Not recorded for this paper

View statement
Looking for related papers…
Contents