EconBase
← Back to paper

Permutation inference with a finite number of heterogeneous clusters

Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.

46,690 characters · 4 sections · 42 citation commands

Rendered from LaTeX for readability, not typeset faithfully. Citation keys are highlighted; maths is left as source; figures, tables and equation environments are summarised rather than reproduced; unrecognised commands are greyed out so nothing is silently dropped. Email addresses are removed.

Permutation inference with a finite number of heterogeneous clusters

\address{University of Michigan, Stephen M. Ross School of Business, 701 Tappan Ave, Ann Arbor, MI 48109, USA. Tel.: +1 (734) 615-6663} \email{[email removed]} \urladdr{\href{https://umich.edu/ hagem}{umich.edu/ hagem}}

abstractI introduce a simple permutation procedure to test conventional (non-sharp) hypotheses about the effect of a binary treatment in the presence of a finite number of large, heterogeneous clusters when the treatment effect is identified by comparisons across clusters. The procedure asymptotically controls size by applying a level-adjusted permutation test to a suitable statistic. The adjusted permutation test is easy to implement in practice and performs well at conventional levels of significance with at least four treated clusters and a similar number of control clusters. It is particularly robust to situations where some clusters are much more variable than others. \vskip .5em JEL classification: C01, C12, C21\\ Keywords: cluster-robust inference, randomization, permutation, Behrens-Fisher

Introduction

It has become widespread practice in economics to conduct inference that is robust to within-cluster dependence. Typical examples of clusters are states, counties, cities, schools, firms, or stretches of time. Units within the same cluster are likely to influence one another or are influenced by the same external shocks. Several analytical and computationally intensive procedures such as the bootstrap are available to account for the presence of data clusters. Most of these procedures achieve consistency by requiring the number of clusters to go to infinity. Numerical evidence by bertrandetal2004, mackinnonwebb2014, and others suggests that this type of asymptotics often translates into heavily distorted inference in empirically relevant situations when the number of clusters is small or the clusters are heterogenous. In both situations, the overall finding is that true null hypotheses are rejected far too often. In this paper, I introduce an adjusted permutation procedure that is able to asymptotically control the size of tests about the effect of a binary treatment in the presence of finitely many large and heterogeneous clusters. The procedure applies to difference-in-differences estimation and other situations where treatment occurs in some but not all clusters and the treatment effect of interest is identified by between-cluster comparisons.

The main theoretical insight of this paper is that classical permutation inference can be adjusted to test the null hypothesis of equality of means of two finite samples of mutually independent but arbitrarily heterogeneous normal variables. This runs counter to classical permutation testing hoeffding1952, where the data under the null are presumed to be exchangeable. The adjustment corrects the significance level of the test downwards to account for heterogeneity. I prove that this is possible for empirically relevant levels of significance if both samples consist of more than three observations. The corrections needed for all standard levels of significance are tabulated in the paper. I also show that if a random vector of interest converges weakly to multivariate normal with diagonal covariance matrix, then permutation inference remains approximately valid for that vector. To exploit this result in a cluster context, I construct asymptotically normal statistics from each cluster and then apply adjusted permutation inference to the collection of these statistics. The resulting permutation test is consistent against all fixed alternatives to the null, powerful against local alternatives, and is free of user-chosen parameters.

The strategy of using cluster-level estimates as the basis for a test goes back at least to famamacbeth1973, who without formal justification run $t$ tests on regression coefficients obtained from year-by-year cross-sectional regressions. Their approach is generalized and formalized by ibragimovmueller2010, ibragimovmueller2016, who construct $t$ statistics from cluster-level estimates and show that for certain combinations of numbers of clusters and significance levels these statistics can be compared to Student $t$ critical values. The \citetalias{ibragimovmueller2016} test and the adjusted permutation test complement one another because they both rely on finite-sample inference with heterogeneous normal variables but apply to non-nested combinations of numbers of clusters and significance levels. The empirical example in this paper features a practically relevant situation where the \citetalias{ibragimovmueller2016} test does not apply but the adjusted permutation test does. If both tests apply, the Monte Carlo results in this paper indicate that neither test dominates the other in terms of power but the adjusted permutation test has clear advantages if the underlying data are heavy tailed.

Several other papers show that inference with a fixed number of clusters is possible under a variety of conditions: canayetal2014 permute the signs of cluster-level statistics under symmetry assumptions. This approach requires the parameter of interest to be identified within each cluster and clusters therefore have to be paired in an ad-hoc manner for difference-in-differences estimation. This pairing has a substantial impact on the test decision and requires a large number of choices on the part of the researcher. besteretal2014 use standard cluster-robust covariance matrix estimators but adjust critical values under homogeneity assumptions on the clusters. canayetal2018 show that certain cluster-robust versions of the wild bootstrap can be valid under strong homogeneity assumptions with a fixed number of clusters. In sharp contrast, the test developed here does not require pairing clusters or any other decisions on the part of the researcher and applies even if the clusters are arbitrarily heterogeneous.

I will use the following notation: $1\{\cdot\}$ is the indicator function, $\min\{a,b \} = a\wedge b$, and cardinality of a set $A$ is $|A|$. The smallest integer larger than $a$ is $\lceil a \rceil$ and the largest integer smaller than $a$ is $\lfloor a \rfloor$. Limits are as $n\to\infty$ unless noted otherwise.

All proofs can be found in the online appendix.

Permutation inference with heterogenous symmetric variables

In this section I show that classical permutation inference can be adjusted to test for the equality of location of two finite samples of independent symmetric variables with heterogeneous scales. The discussion focuses on heterogeneous normal variables but several of the results apply more generally.

Suppose the random vector $X = (X_1,\dots, X_q)\in\mathbb{R}^q$ has entries $X_k = \mu_1 + \sigma_k Z_k$ for $1\leqslant k\leqslant q_1$ and $X_k = \mu_0 + \sigma_k Z_k$ for $q_1 +1 \leqslant k\leqslant q_1 + q_0 = q$, where the $Z_1,\dots,Z_q$ are iid symmetric variables. The $\sigma_k$ are not known and no estimates are assumed to be available. The number of variables $q$ is taken as fixed throughout this paper. The goal is to construct an $\alpha$-level permutation test of the hypothesis $H_0\colon \mu_1=\mu_0$. This is a two-sample problem with “treatment” sample $X_1,\dots, X_{q_1}$ and “control” sample $X_{q_1+1},\dots, X_q$. The test statistic $T$ considered here is the comparison of means

equation[equation omitted — 139 chars of source]

No standardization is needed.

Let $\mathfrak{S}_q$ be the group of permutations of the set $\{1,\dots, q\}$. For $g\in\mathfrak{S}_q$, denote by $g(k)$ the value the permutation $g$ assigns to $k$ for $1\leqslant k\leqslant q$. The “group action” on $X$ in $\mathfrak{S}_q$ is the relabeling of the indices $gX = (X_{g(1)},\dots, X_{g(q)})$. A permutation test derives its critical values from the permutation statistics $T(gX)$. Because $x\mapsto T(x)$ is invariant to the ordering of the first $q_1$ and last $q_0$ entries of $x$, it suffices to compute the $T(gX)$ for the set of group actions with unique combinations of $g(1),\dots, g(q_1)$ and $g(q_1 + 1),\dots, g(q)$. One way of representing this set is

equation[equation omitted — 146 chars of source]

Denote by $T^{(1)}(X,\mathfrak{G}) \leqslant T^{(2)}(X,\mathfrak{G})\leqslant \cdots \leqslant T^{(|\mathfrak{G}|)}(X,\mathfrak{G})$ the ordered values of $T(gX)$ as $g$ varies over $\mathfrak{G}$ and define critical values

equation[equation omitted — 123 chars of source]

Classical permutation inference operates under the null hypothesis that $X$ has the same distribution as $gX$ for all $g\in\mathfrak{S}_q$. In the present context this would be equivalent to assuming that $\mu_1 = \mu_0$ and that all $\sigma_k$ are identical under the null. An argument due to hoeffding1952 would then show that $T^{\alpha}(X,\mathfrak{G})$ could be used as the critical value for an $\alpha$-level test against the alternative $H_1\colon \mu_1> \mu_0$. If the null hypothesis is weakened to $H_0\colon \mu_1=\mu_0$ without restrictions on $\sigma_k$, a natural question to ask if there exists any order statistic $j\mapsto T^{(j)}(X,\mathfrak{G})$, $\lceil(1-\alpha)|\mathfrak{G}|\rceil\leqslant j< |\mathfrak{G}|$, that can be used as a critical value for an $\alpha$-level test even if the classical permutation hypothesis $X\sim gX$ for all $g\in\mathfrak{S}_q$ fails. As I will discuss now, the answer to this question is affirmative for empirically relevant choices of $\alpha$ if $q_1$ and $q_0$ are larger than $3$.

Because $T(X)\in \{ T(gX) : g\in\mathfrak{G} \}$, it is always true that $T(X) \leqslant T^{(|\mathfrak{G}|)}(X,\mathfrak{G})$. The largest non-trivial critical value from $\{ T(gX) : g\in\mathfrak{G} \}$ is therefore the second largest order statistic $T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})$. The following theorem shows that the probability that $T(X)$ exceeds $T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})$ is necessarily small under $H_0\colon \mu_1=\mu_0$. In fact, this probability is so small that $T(X) > T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})$ is well below any standard choice of $\alpha$ for most values of $q_1$ and $q_0$. By monotonicity, the existence of a $j$ such that ${\mathord P} (T(X) > T^{(j)}(X,\mathfrak{G}))\leqslant \alpha$ is then guaranteed.

theorem[Size for heterogeneous symmetric variables] Let $X = (X_1,\dots, X_q)$ with $X_k = \mu + \sigma_k Z_k$, $1\leqslant k\leqslant q$, where $\sigma_1,\dots, \sigma_q >0$ and the $Z_1,\dots, Z_q$ are iid copies of a continuous random variable $Z$. If $Z$ and $-Z$ have the same distribution, then \[\sup_{\mu\in\mathbb{R}, \sigma_1,\dots,\sigma_q>0}{\mathord P} \bigl(T(X) > T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})\bigr) = \frac{1}{2^{q_1\wedge q_0}}.\]

A byproduct of the theorem is a bound for the case where the scales $\sigma_1,\dots, \sigma_q$ are replaced by positive random variables independent of $Z_1,\dots,Z_q$. The $X_k$ are then called “scale mixtures” of a symmetric variable $Z$. The following corollary is immediately obtained from Theorem (ref) by conditioning on a given set of random scales.\footnote{A referee points out that szekely2006 studies one-sample Student $t$-tests for similar classes of distributions. szekely2006 does not deal with permutation inference and uses a fundamentally different proof technique but the results are also powers of two.}

corollary[Size for symmetric scale mixtures] Suppose $X = (X_1,\dots, X_q)$ with $X_k = \mu + S_k Z_k$, $1\leqslant k\leqslant q$, where the $Z_1,\dots, Z_q$ are iid copies of a continuous random variable $Z$ and $(S_1, \dots, S_q$) is a possibly dependent random vector independent of $Z_1,\dots, Z_q$ with $P(S_k > 0) = 1$ for $1\leqslant k\leqslant q$. If $Z$ and $-Z$ have the same distribution, then $\sup_{\mu\in\mathbb{R}}{\mathord P} (T(X) > T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})) \leqslant 1/2^{q_1\wedge q_0}$.

Theorem (ref) shows that a test with critical value $T^{(|\mathfrak{G}|-1)}(X,\mathfrak{G})$ has size $1/2^{q_1\wedge q_0} = 0.0625$, $0.0313$, $0.0156$, $0.0078$, $0.0039$ as $q_1\wedge q_0$ increases from $4$ to $8$. Consequently, a 10%-level permutation test that relies only on symmetry is available with $q_1$ and $q_0$ as small as $4$. One can perform a 5%-level test with $q_1\wedge q_0\geqslant 5$, a 5%-level two-sided test (see the discussion below (ref) ahead) with $q_1\wedge q_0\geqslant 6$, a 1%-level test with $q_1\wedge q_0 \geqslant 7$, and a 1%-level two-sided test with $q_1\wedge q_0 \geqslant 8$.

More generally, Theorem (ref) implies that for many combinations of $q_1$, $q_0$, and $\alpha$ there exist $p\in (0,1)$ such that $\lceil (1-\alpha)|\mathfrak{G}|\rceil \leqslant \lceil (1-p)|\mathfrak{G}|\rceil < |\mathfrak{G}|$ and ${\mathord P} (T(X) > T^{p}(X,\mathfrak{G})) \leqslant \alpha$. The largest such value of $p$ maximizes power while still controlling the size of the test. Finding this $p$ is theoretically and computationally challenging. However, computation can be simplified if $Z$ is restricted to a single distribution. For normal distributions, the best possible $p$ is

multline[multline omitted — 283 chars of source]

where I suppress the dependence on $q_1$ and $q_0$ to prevent notational clutter. By construction, $\bar{\alpha}$ controls the size of the permutation test not only for arbitrarily heterogeneous normal variables but also for the entire class of scale mixtures of normals. This class includes all Student $t$ and Laplace distributions, as well as many other standard distributions gneiting1997. Moreover, because the critical value is from a permutation distribution, the test also controls size for all exchangeable distributions. The remainder of the paper therefore focuses on this $\bar{\alpha}$ and heterogeneous normal $X$ but other choices of distributions are possible.

A convenient feature of $\bar{\alpha}$ is that it does not depend on the data and can therefore be tabulated. To this end, I use a location-scale invariance argument to reduce the inner supremum in (ref) to a supremum over $(0,1]^q$, simulate ${\mathord P}$ over large random grids on $(0,1]^q$, and compute $\bar{\alpha}$ by iteratively searching over these grids. (See Online Appendix (ref) for details.) The search is not exhaustive and does not guarantee that the target quantity in (ref) is found. However, in experiments this method consistently replicated the theoretical result in Theorem (ref) up to a small approximation error, which indicates---but does not unequivocally establish---that this approximation of $\bar{\alpha}$ is reliable.

table[table omitted — 2,964 chars of source]

Table (ref) lists $\bar{\alpha}$ for common choices of $\alpha$ as a function of $q_1$ and $q_0$. As can be seen, the adjustment needed to make inference robust to variance heterogeneity is substantial if $q_1\wedge q_0$ is very small but disappears quickly as $q_1\wedge q_0$ increases. For example, for $q_1 = 4 = q_0$ a robust 10%-level test requires using the 95.62% quantile of the unadjusted test but for $q_1 = 9 = q_0$ the 91% quantile is already sufficient for a robust 10%-level test. For larger numbers of variables the need for adjustment nearly disappears at conventional levels of significance. This is also confirmed by results in hagemann2019, who shows that unadjusted permutation inference in this context with the statistic $T(X)$ is consistent if the number of treated and control units grows in a balanced manner.

The test decision is now simple. For $q_1 \wedge q_0 > 3$, choose $\bar{\alpha}$ for a feasible $\alpha$ from Table (ref) to ensure ${\mathord P} (T(X) > T^{\bar{\alpha}}(X,\mathfrak{G}))\leqslant \alpha$ under $H_0\colon \mu_1 = \mu_0$. The existence of such an $\bar{\alpha}$ for the comparison-of-means test statistic $T$ is guaranteed by Theorem (ref). For an $\alpha$-level test of the null hypothesis $H_0\colon \mu_1 = \mu_0$, reject in favor of the alternative $H_1\colon \mu_1 > \mu_0$ if

equation[equation omitted — 85 chars of source]

For a one-sided test of level $\alpha$ against $\mu_1 < \mu_0$, reject if $T(-X) > T^{\bar{\alpha}}(-X,\mathfrak{G})$ or, equivalently, $T(X) < T^{(\lfloor |\mathfrak{G}|\bar{\alpha} \rfloor)}(X,\mathfrak{G})$. For a two-sided test of level $2\alpha$ against $\mu_1 \neq \mu_0$, reject if $T(X) > T^{\bar{\alpha}}(X,\mathfrak{G})$ or $T(-X) > T^{\bar{\alpha}}(-X,\mathfrak{G})$. Test decisions can also be equivalently made with the p-value of the unadjusted test

equation[equation omitted — 189 chars of source]

because $T(X) > T^{p}(X,\mathfrak{G})$ if and only if $\hat{p}(X, \mathfrak{G}) \leqslant p$ for every $p \in (0,1)$. A $p$-value for a two-sided test can be defined as $2( \hat{p}(X, \mathfrak{G}) \wedge \hat{p}(-X, \mathfrak{G}) ).$ Reject the null hypothesis if the $p$-value does not exceed $\bar{\alpha}$ from Table (ref) to perform an $\alpha$-level test.

Online Appendix (ref) contains additional results on power, stochastic approximation of $\mathfrak{G}$, and large sample approximation of $X$. The next section applies Theorem (ref) to situations where $X$ is the distributional limit of cluster-level statistics.

Permutation inference with heterogenous clusters

In this section, I establish large sample results for an adjusted permutation test with finitely many clusters under a single high-level condition. I then outline how these results can be applied in empirical practice.

\addline

Suppose data from $q$ large clusters (e.g., counties, regions, schools, firms, or stretches of time) are available. Observations are independent across clusters but dependent within clusters. An intervention took place during which clusters $1\leqslant k\leqslant q_1$ received treatment and clusters $q_1 + 1\leqslant k\leqslant q$ did not. The quantity of interest is a treatment effect or an object related to a treatment effect that can be represented by a scalar parameter $\delta$. Because entire clusters receive treatment, this parameter is only identified up to a location shift $\theta_0$ within a treated cluster. Hence, only the left-hand side of \[ \theta_1 = \theta_0 + \delta \] can be identified from such a cluster. If the clusters have similar characteristics, then $\theta_0$ can be identified from an untreated cluster. Comparing the two clusters identifies $\delta$.

The identification strategy outlined in the preceding paragraph is the basis for differences-in-differences estimation---arguably the most popular identification strategy in economics today---and a variety of other models. The purpose of this section is to use the results from Section (ref) to develop a permutation test of the conventional (non-sharp) hypothesis \[H_0\colon \delta = 0, \] or, equivalently, $H_0\colon \theta_1 = \theta_0$. The idea is to obtain independent estimates \smash{$\hat{\theta}_{n,1},\dots, \hat{\theta}_{n,q_1}$} of $\theta_1$ and independent estimates \smash{$\hat{\theta}_{n,q_1 + 1},\dots, \hat{\theta}_{n,q}$} of $\theta_0$ so that $\hat{\theta}_n = (\hat{\theta}_{n,1},\dots, \hat{\theta}_{n,q})$ is approximately multivariate normal with diagonal covariance matrix. The following example outlines a simple situation where this is possible.

example[Difference in differences] Consider the regression model \begin{equation} Y_{t,k} = \theta_0 I_t + \delta I_t D_{k} + \beta_k' X_{t,k} + \zeta_k + U_{t,k}, \end{equation} where $k$ indexes individual units, $t$ indexes time, $I_t=1\{t>n_{0,k}\}$ indicates time periods after an intervention at a known time $n_{0,k}$, the dummy $D_k$ indicates whether unit $k$ eventually received treatment, and the $\zeta_k$ are individual fixed effects. Provided $U_{t,k}$ has conditional mean zero and the covariates $X_{t,k}$ vary before or after $n_{0,k}$, the data identify $\theta_1 = \theta_0 + \delta$ in a treated cluster and $\theta_0$ in an untreated cluster. View each cluster as a separate regression and rewrite (ref) as \begin{equation} Y_{t,k} = \begin{cases} \theta_1 I_t + \beta_k' X_{t,k} + \zeta_k + U_{t,k}, &1\leqslant k\leqslant q_1, \\ \theta_0 I_t + \beta_k' X_{t,k} + \zeta_k + U_{t,k}, &q_1< k\leqslant q \end{cases} \end{equation} and use the least squares estimates $\hat{\theta}_{n,k}$ of $\theta_1$ and $\theta_0$ as $\hat{\theta}_n = (\hat{\theta}_{n,1},\dots, \hat{\theta}_{n,q})$. \leavevmode\unskip\penalty9999 \hbox\nobreak \quad\hbox{\ensuremath{\square}}

The cluster-level statistics $\hat{\theta}_n$ can be combined with the results in the previous section to perform a consistent permutation test as the sample size $n$ grows large. The test is not limited to the $\hat{\theta}_n$ constructed in the preceding example. Instead, the key high-level condition is that a centered and scaled version of some estimate $\hat{\theta}_n$ converges to a $q$-dimensional standard normal distribution,

equation[equation omitted — 339 chars of source]

The $\sigma_1,\dots, \sigma_q$ may depend on $\theta_1$ or $\theta_0$ but are not presumed to be known or estimable by the researcher. This is an important feature of the test because consistent covariance matrix estimation would require knowledge of an explicit ordering of the dependence structure within each cluster. While ordering the data is straightforward for time-dependent data, it may be difficult or impossible to infer or credibly assume an ordering of the data within villages or schools. In contrast, (ref) can be established under weak dependence assumptions where it is only presumed that there exists a possibly unknown ordering for which the dependence decays at a certain rate. machkouriaetal2013 present easy-to-use moment bounds and limit theorems for this situation; see also besteretal2014 for further results.

I now show that under the joint convergence (ref) a permutation test based on comparison of means of $\smash{\hat{\theta}_{n,1},\dots, \hat{\theta}_{n,q_1}}$ and \smash{$\hat{\theta}_{n,q_1 + 1},\dots, \hat{\theta}_{n,q}$} can be adjusted to be asymptotically of level $\alpha$ with a fixed number of clusters. This is possible for $q_1 \wedge q_0 > 3$ if $\bar{\alpha}$ in Table (ref) is available at the desired significance level $\alpha$. In that case, the test has power against fixed alternatives $\theta_1 = \theta_0 + \delta$ with $\delta > 0$ and local alternatives $\theta_1 = \theta_0 + \delta/\sqrt{n}$ converging to the null. In the latter situation, $\theta_0$ is fixed and $\theta_1$ implicitly depends on $n$. The convergence in (ref) is then no longer pointwise in $\theta = (\theta_1,\theta_0)$ but a statement about the sequence $\theta_n = (\theta_0 + \delta/\sqrt{n}, \theta_0)$. As before, the test can be made two-sided to have power against fixed and local alternatives from either direction. Let $x\mapsto\tilde{\Phi}_{\theta_0}(x) = \prod_{1\leqslant k\leqslant q_0}\Phi(x/\sigma_{k+q_1}(\theta_0))$.

theorem[Consistency and local power] Suppose (ref) holds. If $\theta_1 = \theta_0$, then \[\lim_{n\to\infty}{\mathord P}_\theta \bigl( T(\hat{\theta}_n) > T^{\bar{\alpha}}(\hat{\theta}_n,\mathfrak{G})\bigr) \leqslant \alpha.\] Let $\bar{\alpha} \geqslant 1/|\mathfrak{G}|$. If $\theta_1 = \theta_0 + \delta$ with $\delta > 0$, then ${\mathord P}_\theta ( T(\hat{\theta}_n) > T^{\bar{\alpha}}(\hat{\theta}_n,\mathfrak{G})) \to 1$. If $\theta_1 = \theta_0 + \delta/\sqrt{n}$ and the $\sigma_1,\dots, \sigma_{q}$ are continuous and positive at $\theta_0$, then \begin{equation} \lim_{n\to\infty}{\mathord P}_{\theta_n} \bigl(T(\hat{\theta}_n) > T^{\bar{\alpha}}(\hat{\theta}_n,\mathfrak{G})\bigr) \geqslant \int_0^1 \prod_{1 \leqslant j \leqslant q_1} \Phi \Biggl( \frac{\delta - \tilde{\Phi}^{-1}_{\theta_0}(t)}{\sigma_j(\theta_0)} \Biggr)dt. \end{equation}
remarks(i) Because $T(\hat{\theta}_n) > T^{\bar{\alpha}}(\hat{\theta}_n,\mathfrak{G})$ if and only if $T(a(\hat{\theta}_n - \theta_0 1_q)) > T^{\bar{\alpha}}(a(\hat{\theta}_n - \theta_01_q),\mathfrak{G})$, where $a> 0$ and $1_q$ is a $q$-vector of ones, the root-$n$ rate in (ref) and in the theorem can be replaced by any other rate as long as the asymptotic normal distribution in (ref) is still attained. The theorem therefore covers several semiparametric or nonstandard estimators. (ii) To test $H_0\colon \theta_1 = \theta_0 + \lambda$ for a given $\lambda$, define $\Lambda = (\lambda 1\{k\leqslant q_1 \})_{1\leqslant k\leqslant q}$ and reject if $T(\hat{\theta}_n - \Lambda) > T^{\bar{\alpha}}(\hat{\theta}_n - \Lambda,\mathfrak{G})$. Consistency follows from part (i) of this remark and Theorem (ref). (iii) If evaluating all elements of $\mathfrak{G}$ is too costly, the computational burden can be reduced by working with a random sample $\mathfrak{G}_m$ of $m$ random draws from $\mathfrak{G}$. As long as $m\to\infty$ and then $n\to\infty$, the theorem and parts (i)-(ii) of this remark also hold for $\mathfrak{G}_m$ with the exception of the local power bound if $\bar{\alpha}|\mathfrak{G}|$ happens to be an integer. In that case, the inequality (ref) holds after subtracting ${\mathord P}(\hat{p}(Y, \mathfrak{G}) = \bar{\alpha})/2$ from its right-hand side, where $Y = (\sigma_1(\theta_0)Z_1, \dots, \sigma_q(\theta_0)Z_q)$, the $Z_1,\dots, Z_q$ are independent standard normal, and $\hat{p}$ is defined in (ref). This corrects for the discreteness of the test. (See also Online Appendix (ref).) \leavevmode\unskip\penalty9999 \hbox\nobreak \quad\hbox{\ensuremath{\square}}
example[Difference in differences, cont.] Suppose there are $n_{0,k}$ pre-intervention and $n_{1,k}$ post-intervention periods for unit $k$. The data from the $n_k = n_{0,k} + n_{1,k}$ time periods available for unit $k$ are the $k$-th cluster. Let $n = \sum_{k=1}^q n_k$. In the absence of covariates (i.e., $\beta_k\equiv 0$), each least squares estimate in (ref) satisfies \[ \sqrt{n}(\hat{\theta}_{n,k} - \theta_0) = \biggl(\frac{n}{n_{1,k}}\biggr)^{1/2} n_{1,k}^{-1/2}\sum_{t=n_{0,k}+ 1}^{n_{k}}U_{t,k} - \biggl(\frac{n}{n_{0,k}}\biggr)^{1/2} n_{0,k}^{-1/2}\sum_{t=1}^{n_{0,k}}U_{t,k} \] under $H_0$. If the pre-intervention and post-intervention periods are long in the sense that $n/n_{0,k} \to c_{0,k} \in (0,\infty)$ and $n/n_{1,k} \to c_{1,k} \in (0,\infty)$ for $1\leqslant k\leqslant q$, then condition (ref) already holds if $n^{-1/2}(\sum_{t=1}^{n_{0,k}}U_{t,k},$ $\sum_{t=n_{0,k}+ 1}^{n_{k}}U_{t,k})$ is independent across $1\leqslant k\leqslant q$ and has a non-degenerate normal limiting distribution for each $k$. A large number of central limit theorems for time dependent data exist; see, e.g., white2001. Alternatively, if relatively few post-intervention periods are available so that $n_1 = \sum_{k=1}^q n_{1,k}$ satisfies $n_{1}/n_{0,k} \to 0$ and $n_1/n_{1,k} \to c_{1,k} \in (0,\infty)$ for $1\leqslant k\leqslant q$, the scale invariance of the test allows replacement of the $\sqrt{n}$ in (ref) by $\sqrt{n_1}$. Then (ref) holds if $n_{0,k}^{-1/2}\sum_{t=1}^{n_{0,k}}U_{t,k} = O_P(1)$ and $n_{1,k}^{-1/2}\sum_{t=n_{0,k}+ 1}^{n_{k}}U_{t,k}$ obeys a central limit theorem for $1\leqslant k\leqslant q$. This argument also applies if relatively few pre-intervention periods are available with the roles of $n_{0,k}$ and $n_{1,k}$ reversed. If the pre-intervention and post-intervention periods are short, Theorem (ref) implies that the permutation test can still be applied if $(U_{t,k})_{1\leqslant t\leqslant n_k}$ is multivariate normal for $1\leqslant k\leqslant q$. The calculations in the preceding paragraph can be adjusted to include covariates. Similar calculations also apply if each cluster is a collection of individual-level data over time, although in that case more general limit theory is needed. See, e.g, jenischprucha2009 and machkouriaetal2013 for appropriate results. The model in (ref) can be modified in several ways. For instance, cluster-specific $\delta_k$ can be assumed instead of a fixed $\delta$. The null hypothesis is then $\delta_k = 0$ for all $k\leqslant q_1$ and the test has power against the alternative $\min_{k\leqslant q_1} \delta_k > 0$ without changes to estimation and inference. (Conversely, the parameter $\beta_k$ does not need to vary across clusters for the results to go through.) The method discussed here can also be applied in difference-in-difference designs with staggered adoption chaisemartindhaultfoeille2020. However, as rothetal2022 point out, $\theta_0$ cannot vary by cluster, which rules out heterogeneous trends in untreated potential outcomes across clusters. \leavevmode\unskip\penalty9999 \hbox\nobreak \quad\hbox{\ensuremath{\square}}

Online Appendix (ref) provides more practical guidance for the implementation of the adjusted permutation test and applies the test to several standard econometric models.

Numerical results

This section studies the behavior of the adjusted permutation test and related methods in a Monte Carlo experiment and in data from a randomized trial. The discussion focuses on one-sided tests to the right but the results apply more generally. Online Appendix (ref) contains additional numerical examples and empirical applications.

example[Difference in differences, cont.] This example explores the behavior of the adjusted permutation (AP hereafter) test, the ibragimovmueller2016 test (see Online Appendix (ref) for a description and more results), the besteretal2014 test, and a clustered wild bootstrap cameronetal2008 in a version of a Monte Carlo experiment in conleytaber2011. The BCH test estimates parameters by least squares in the pooled sample and standardizes this estimate with the usual cluster-robust covariance matrix with a degrees-of-freedom adjustment. The resulting statistic is compared to the $1-\alpha$ quantile of $t$ distribution with $q-1$ degrees of freedom. BCH show that this test is valid for certain ranges of $q$ and $\alpha$ under regularity conditions if the distribution of the covariates is very similar across clusters. The WCB takes the same statistic but compares it to the bootstrap distribution of the statistic obtained from the cluster-robust version of the wild bootstrap using the Rademacher distribution and with the null imposed. This procedure is outlined in detail in cameronetal2008. It is valid with $q\to \infty$ djogbenouetal2019 under mild homogeneity conditions and valid for fixed $q$ under strong homogeneity conditions canayetal2018. The bootstrap here uses 199 repetitions. The data generating process is the model in (ref) specialized to \begin{gather*} Y_{t,k} = \theta_0 I_t + \delta I_t D_{k} + \beta_1 X_{1, t,k} + \beta_2 X_{2, t,k} + \beta_3 X_{3, t,k} + \zeta_k + U_{t,k},\\ U_{t, k} = \rho U_{t-1, k} + V_{t,k}, \qquad X_{1, t,k} = \gamma I_t D_{k} + W_{t,k}, \end{gather*} with $\theta_0 = \beta_1 = \beta_2 = \beta_3 = 1$, $\zeta_k\equiv 1$, $\rho = 0.5$, and $\gamma = 0.8$. As before, $I_t = 1\{ t > n_{0,k} \}$ is a post-intervention indicator and $D_k$ is a treatment indicator. There are $n_{0,k} \equiv 10$ pre-intervention and $n_{1,k}\equiv 10$ post-intervention periods, six clusters received treatment, and six did not. I consider $(X_{2,t,k}, X_{3,t,k}, V_{t,k}, W_{t,k}) \sim N(0, \sigma_k^2 \mathrm{I})$ for every $1\leqslant k\leqslant q$ and $t$. The experiment varies $\delta \in \{0, 1, 2, 3\}$ and cluster heterogeneity $h$ as follows: for $h\in\{ 1, 3, 5, 7 \}$, the last $h$ clusters had $\sigma_{q-h+1} = \dots = \sigma_q = 20$ and the remaining $q-h$ clusters had $\sigma_{1} = \dots = \sigma_{q-h} = 1$. \begin{table}\caption{Rejection frequencies of the adjusted permutation test (AP) test, \citetalias{ibragimovmueller2016} (IM) test, \citetalias{besteretal2014} (BCH) test, wild cluster bootstrap (WCB), and an oracle version of the \citetalias{canayetal2014} (CRS) test for increasing degrees of heterogeneity $h$ in Example (ref).} \scalebox{.9}{ \begin{tabular}{cp{0cm}cccccp{0cm}ccccc} \hline & & \phantom{oracle} & \phantom{oracle} & \phantom{oracle} & \phantom{oracle} & oracle & & \phantom{oracle} & \phantom{oracle} & \phantom{oracle} & \phantom{oracle} & oracle \\ & & AP & IM & BCH & WCB & CRS & & AP & IM & BCH & WCB & CRS \\ \cline{3-7} \cline{9-13} $h$ & & \multicolumn{5}{c}{$\delta = 0$ (size)} & & \multicolumn{5}{c}{$\delta = 1$ (power)} \\ \cline{1-1}\cline{3-7} \cline{9-13} 1 & & .0244 & .0086 & .0265 & .0392 & .0474 & & .2826 & .1176 & .2930 & .3981 & .4437 \\ 3 & & .0316 & .0287 & .0641 & .0538 & .0513 & & .1214 & .0706 & .1433 & .1493 & .1627 \\ 5 & & .0377 & .0507 & .0787 & .0635 & .0451 & & .0549 & .0662 & .1086 & .0887 & .0792 \\ 7 & & .0358 & .0475 & .0735 & .0634 & .0442 & & .0438 & .0560 & .0924 & .0791 & .0659 \\ \rule{0pt}{3ex} & & \multicolumn{5}{c}{$\delta = 2$ (power)} & & \multicolumn{5}{c}{$\delta = 3$ (power)} \\ \cline{3-7} \cline{9-13} 1 & & .5541 & .3142 & .5631 & .6234 & .6036 & & .6227 & .4797 & .7001 & .7054 & .6799 \\ 3 & & .1896 & .1263 & .2375 & .2435 & .2410 & & .2445 & .1900 & .3448 & .3420 & .3056 \\ 5 & & .0728 & .0889 & .1566 & .1325 & .1192 & & .0982 & .1188 & .2214 & .1897 & .1565 \\ 7 & & .0533 & .0707 & .1306 & .1110 & .0908 & & .0715 & .0915 & .1715 & .1488 & .1168 \\ \hline \end{tabular} } \end{table} Table (ref) shows the rejection frequencies of the four tests outlined above under the null and the alternative. Each entry was computed from 10,000 Monte Carlo simulations and all methods were faced with the same data. As can be seen, all tests were conservative when there was little heterogeneity ($h=1$). However, the BCH test and the WCB were no longer able to control size as the heterogeneity increased. The over-rejection in both methods led to higher rejection frequencies under the alternative, which therefore should not be viewed as evidence of their power. The AP test rejected far more false nulls than the IM test when there was little heterogeneity. As the heterogeneity increased, the IM test had a slight advantage. The BCH test and the WCB performed well at $h=1$. However, even then there was little cost to using the AP test. It rejected nearly as many false nulls as the BCH test and at most 11.55 percentage points fewer false nulls than the WCB but was able to control size. Several other methods for inference specifically designed for difference in differences such as donaldlang2007 and conleytaber2011 are available. Here I focus only on methods that apply more broadly and that are valid with a fixed number of clusters. The test of canayetal2014 technically applies here but requires matching each treated cluster with a control cluster. In the present example, there are $6! = 720$ potential matches and equally many potential tests. A single match is enough to perform the test but different matches can lead to different test outcomes. This arbitrariness can be unattractive in applied work because the number of ways in which tests can be selected (and potentially combined) is large. However, if a pilot study or pre-analysis plan prescribed the cluster pairs, the (randomized) CRS test would be asymptotically similar and therefore provides a useful benchmark for the AP test. To this end, Table (ref) shows results of an oracle version of the CRS test that presumes that a pre-analysis plan is in place. As can be seen, the AP test compares well to the CRS test while completely avoiding the issue that different cluster pairs can lead to different test results. \leavevmode\unskip\penalty9999 \hbox\nobreak \quad\hbox{\ensuremath{\square}}
example[Achievement awards; angristlavy2009] In this example, I reanalyze data from a randomized trial of angristlavy2009 in Israel. Their intervention provided cash rewards to low-achieving high school students if they performed well on the Bagrut certification exams for university admission in Israel. I follow the analysis in Table 5 of angristlavy2009 and focus on 32 schools in the sample for which Bagrut rates from 2000 to 2002 are available. Of these schools, 15 received treatment and 17 did not. Because 5 schools did not comply with treatment, the estimates below should be interpreted as intent-to-treat effects. Following angristlavy2009, I investigate the performance of girls in the June 2001 exams who were close to achieving Bagrut certification in the sense that they were ranked above the median of the credit-weighted January 2001 scores of girls. The sample also includes all girls who were above the median in 2000 and 2002. The 2948 girls who met these criteria had an above 50% chance of Bagrut certification. I view each school over time as a cluster, which yields an average cluster size of approximately 92 students. angristlavy2009 report a large number of specifications. I consider a version of their fixed-effects model and estimate $Y_{i,t,k} = \theta_0 I_t + \delta D_k I_t + \eta J_t + \beta \mathit{top}_i + \zeta_k + U_{i,t,k},$ where $i$ indexes students, $t$ indexes time, $k$ indexes schools, $Y_{i,k}$ indicates Bagrut status, $D_k$ is the treatment indicator, $I_t$ equals $1$ in 2001 and is $0$ otherwise, $J_t$ equals $1$ in 2002 and is $0$ otherwise, $\mathit{top}_i$ indicates whether a student is in the top quartile of the pre-Bagrut grade distribution of girls in the cohort, and $\zeta_k$ is a school fixed effect. angristlavy2009 estimate several related specifications by logit in their Table 5. They report heteroskedasticity-robust standard errors for that table and argue that clustering is accounted for by their fixed effects. For simplicity and ease of interpretation, I estimate the model by least squares. The model predicts an average increase in the probability of receiving Bagrut status by $0.114$ relative to a mean of $0.539$ with a robust standard error of $0.037$. A null of no effect against the alternative that $\delta$ is positive is rejected at any conventional significance level if standard normal critical values are used. This is in line with Table 5, col. (3) of angristlavy2009, who report significant effects ranging from $0.093$ to $0.168$ with standard errors ranging from $0.039$ to $0.045$ for this sample and several subsamples. \begin{figure}[t] \caption{Histogram of the permutation distribution of $T(\hat{\theta}_n) \approx 0.132$ (solid black line) from Example (ref) with 90%, 95%, and 99% critical values (dotted lines).} \end{figure} To apply the adjusted permutation test, I view each cluster as an individual regression and separately estimate each of the $q=32$ equations in \begin{equation*} Y_{i,t,k} = \begin{cases} \theta_1 I_t + \eta J_t + \beta \mathit{top}_i + \zeta_k + U_{i,t,k}, &1\leqslant k\leqslant 15, \\ \theta_0 I_t + \eta J_t + \beta \mathit{top}_i + \zeta_k + U_{i,t,k}, &15< k\leqslant 32. \end{cases} \end{equation*} Note that $\zeta_k$ is now simply the constant term in each regression. The resulting test statistic $T(\hat{\theta}_n) \approx 0.132$ can be viewed as an alternative point estimate of $\delta$ and is comparable in magnitude to the estimates reported in angristlavy2009. However, as can be seen in Figure (ref), which plots the permutation distribution from 100,000 draws together with the corresponding critical values, the adjusted permutation test only rejects the null of no effect in favor of a positive effect at the 10% level and barely does not reject at the 5% level. If the fixed effects in the regression do not fully account for the within-cluster dependence in the data, the positive effect for girls may therefore be far less significant than previously reported. This result in also line with angristlavy2009, who find substantial but statistically marginal positive effects for girls across a wide variety of plausible specifications when they use cluster-robust standard errors. Also note that the 5% and 10% level one-sided tests performed here are outside the feasible range of the ibragimovmueller2016 test. For the canayetal2014 test, there are $17!/2 \approx 1.78\times 10^{14}$ ways of testing if 15 treated clusters are paired with 15 control clusters and two control clusters are dropped. In 1,000 randomly chosen unique pairings, the canayetal2014 test rejected the null of no effect against $\delta > 0$ for 425 pairings at the 5% level and in 48 pairings at the 1% level. Any desired conclusion could be reached by choosing a specific pairing. \leavevmode\unskip\penalty9999 \hbox\nobreak \quad\hbox{\ensuremath{\square}}