EconBase
← Back to paper

Nonparametric Regression under Cluster Sampling

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.

108,373 characters · 17 sections · 75 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.

Nonparametric Regression under Cluster Sampling

\address{Department of Economics, University of Wisconsin, Madison. 1180 Observatory Drive, Madison, WI 53706-1393, USA.} \email{[email removed]}

abstractThis paper develops a general asymptotic theory for nonparametric kernel regression in the presence of cluster dependence. We examine nonparametric density estimation, Nadaraya-Watson kernel regression, and local linear estimation. Our theory accommodates growing and heterogeneous cluster sizes. We derive asymptotic conditional bias and variance, establish uniform consistency, and prove asymptotic normality. Our findings reveal that under heterogeneous cluster sizes, the asymptotic variance includes a new term reflecting within-cluster dependence, which is overlooked when cluster sizes are presumed to be bounded. We propose valid approaches for bandwidth selection and inference, introduce estimators of the asymptotic variance, and demonstrate their consistency. In simulations, we verify the effectiveness of the cluster-robust bandwidth selection and show that the derived cluster-robust confidence interval improves the coverage ratio. We illustrate the application of these methods using a policy-targeting dataset in development economics.

Introduction

Nonparametric regression is widely used in economics for its flexibility. Typically, data are assumed to be independently and identically distributed; however, in reality, observations may exhibit dependence within a group structure called a cluster. Examples of clusters are classrooms, schools, families, hospitals, firms, industries, villages, regions, and so on. The cluster sampling framework assumes independence between observations from different clusters but allows dependence within each cluster.

The previous literature on nonparametric regression under cluster sampling assumes a bounded and homogeneous number of observations per cluster. This assumption may not hold in real data due to heterogeneous cluster sizes. To fill this gap, this paper studies nonparametric kernel regressions that accommodate heterogeneous cluster sizes, including those that grow to infinity asymptotically. Our approach is general, allowing for both bounded and growing clusters simultaneously, and includes cluster-level regressors.

We develop a comprehensive asymptotic theory for nonparametric density estimation, Nadaraya-Watson kernel regression, and local linear estimation. Our results on asymptotic conditional bias and variance, uniform consistency, and asymptotic normality enable us to propose valid methods for bandwidth selection and inference.

For clusters of growing sizes, the asymptotic variance contains a novel term for within-cluster dependence, which does not appear under the assumption of bounded cluster sizes. This term becomes significant due to the potential for a cluster to contain a growing number of observations within a local neighborhood, making cluster dependence non-negligible asymptotically. We propose consistent estimators of the asymptotic variance that account for cluster dependence and validate its importance through simulation. Our cluster-robust confidence interval achieves improved coverage ratios, while conventional confidence intervals could suffer from under-coverage in our simulated datasets.

Nonparametric regression, while significant on its own, also serves as an intermediate tool for other estimators, such as regression discontinuity design, nonparametric auction estimation, and semiparametric models under cluster sampling. Our results could extend to these areas as well.

Related literature

There is a substantial body of literature on cluster sampling in econometrics. C. hansen2007asymptotic provides an asymptotic theory for parametric regression with homogeneous cluster sizes. djogbenou2019asymptotic and B. hansen2019asymptotic extend this theory to heterogeneous cluster sizes. bugni2022inference considers heterogeneous and random cluster sizes for cluster-level randomized experiments. For further literature on parametric models under cluster sampling, the reader can refer to cameron2015practitioner and mackinnon2022cluster.

Conversely, the theory on nonparametric regression under cluster dependence, even with homogeneous cluster sizes, is limited. lin2000nonparametric and wang2003marginal examine local polynomial and local linear regressions, assuming fixed and homogeneous cluster sizes and focusing primarily on asymptotic efficiency. bhattacharya2005asymptotic offers an asymptotic theory for local constant estimators under multi-stage samples, analogous to cluster sampling. When the number of first-stage strata is set to one, his setup becomes a standard cluster sampling with fixed and homogeneous cluster sizes. He puts a similar structure on error terms as this paper, but the fixed cluster sizes render the term reflecting within-cluster dependence asymptotically negligible. For the regression discontinuity literature, bartalotti2017regression has derived asymptotic theories for local polynomial regression under bounded and homogeneous cluster sizes.

menzel2024transfer proposes a method for estimating nonparametric regressions in the presence of cluster dependence, aiming to extrapolate treatment effects across clusters. He considers independent but not identical observations between clusters, with a fixed number of clusters exhibiting uniformly growing size. Our approach differs by incorporating general dependence within a cluster and allowing for both bounded and growing cluster sizes simultaneously, leading to distinct asymptotic results and theories.

To the best of our knowledge, there is no literature on nonparametric models with growing and heterogeneous size clusters except for hu2024some, which became available online after the working paper version of our paper was posted. While both our paper and theirs accommodate flexible cluster sizes, their work concentrates on series regression and does not include any theory on inference, model selection, and kernel regression. Their Assumption 2(i) excludes cluster-level covariates. Our paper adopts the same cluster size framework as djogbenou2019asymptotic and hansen2019asymptotic. The presence of clusters with growing sizes complicates the proofs for asymptotic theories, as cluster dependence becomes non-negligible. Consequently, this paper introduces new technical results for nonparametric regressions under cluster sampling, notably developing Bernstein's inequality for cluster sampling to demonstrate uniform consistency. These novel contributions are believed to offer valuable theoretical tools for future research.

This research also sheds new light on the literature regarding nonparametric regressions with dependence. Following the foundational work on i.i.d. datasets (e.g., stone1982optimal, fan1992design, ruppert1994multivariate), the results have been extended to time series (robinson1983nonparametric, hansen2008uniform, kristensen2009uniform, vogt2012nonparametric, vogt2020multiscale) and spatial datasets (robinson2011asymptotic, lee2016series), as well as to the cluster dependence framework discussed above.

The remainder of this paper is organized as follows: Section $\text{\ref{sec:Cluster-sampling}}$ introduces the cluster sampling framework under consideration. Sections $\text{\ref{sec:Nonparametric-density-estimation}}$-$\text{\ref{sec:Local-linear-estimator}}$ discuss asymptotic theories for nonparametric density estimators, Nadaraya-Watson estimators, and local linear estimators, respectively. Section $\text{\ref{sec:Uniform-convergence}}$ demonstrates uniform convergence of these estimators. Section $\text{\ref{sec:Bandwidth-selection}}$ provides guidelines for selecting bandwidth in nonparametric regressions. Section $\text{\ref{sec:Cluster-robust-variance-estimati}}$ addresses cluster-robust inference. Section $\text{\ref{sec:Monte-Carlo-simulation}}$ presents Monte Carlo simulations for bandwidth selections and inference. Section $\text{\ref{sec:Empirical}}$ illustrates our methods with an application in development economics using a dataset by alatas2012targeting. The paper concludes with Section $\text{\ref{sec:Conclusion}}$. All proofs, technical lemmas, technical discussions, and additional simulation results are included in the Appendix.

Cluster sampling

The researcher observes $\left(Y_{i},X_{i}\right)\in\mathbb{R}\times\mathbb{R}^{d}$ for $i=1,\ldots,n$, with cluster sizes given by $n_{g}\in\{1,2,\cdots\}$ for $g=1,\ldots,G$. Here, $Y_{i}$ represents a dependent variable, and regressors $X_{i}$ are continuous random variables with the Lebesgue density $f(x)$. Assume that each observation can be grouped into one cluster.\footnote{Formally, we assume that for any $i$, we know a function $g(i)\in\{1,\cdots,G\}$.} Thus, the total number of observations is $n=\sum_{g=1}^{G}n_{g}$. To explicitly represent the cluster structure, we also use the notation $\left(Y_{gj},X_{gj}\right)$ for $g=1,\ldots,G$ and $j=1,\ldots,n_{g}$. We treat cluster size $n_{g}$ as nonrandom and possibly heterogeneous across clusters. We assume that observations belonging to different clusters are mutually independent but permit general dependence within the same cluster. We decompose $X_{gj}$ into $X_{gj}=\left(X_{gj}^{(\mathrm{ind})\top},X_{g}^{(\mathrm{cls})\top}\right)^{\top}\in\mathbb{R}^{d}$ where $X_{gj}^{(\mathrm{ind})}\in\mathbb{R}^{d_{\mathrm{ind}}}$ represents individual-level regressors and $X_{g}^{(\mathrm{cls})}\in\mathbb{R}^{d_{\mathrm{cls}}}$ represents cluster-level regressors. We assume that the regressors contain at least one individual-level regressors, $d_{\mathrm{ind}}\geq1$. By construction, $d=d_{\mathrm{ind}}+d_{\mathrm{cls}}$ holds.

We denote $\mathbf{X}_{g}=\left(X_{g1},\dots,X_{gn_{g}}\right)$ and aim to estimate the nonparametric regression model:

align[align omitted — 194 chars of source]

We also assume

align[align omitted — 503 chars of source]

The model specified through $\text{\eqref{eq:estimand}}$-$\text{\eqref{eq:cond_cov_model}}$ exhibits greater flexibility than initially apparent. The constraint imposed by $\text{\eqref{eq:cond_var_model}}$ is that the conditional variance of the error term for an individual is dependent only on the individual's own regressors, both at the individual and cluster levels. Additionally, $\text{\eqref{eq:cond_cov_model}}$ states that the conditional covariance of the error terms between any two individuals within the same cluster is a function only of their individual-level regressors and shared cluster-level regressors. This framework accommodates the inclusion of cluster random effects in $e_{gj}$ and allows for the dependence of regressors within clusters. In economic applications, cluster dependencies often arise from strategic interactions within the cluster or from cluster-level unobserved shocks, including measurement errors.

assumptionWe assume the following data-generating process: \begin{enumerate} • The pairs $\left(Y_{gj},X_{gj}\right)$ and $\left(Y_{g^{\prime}\ell},X_{g^{\prime}\ell}\right)$ are mutually independent for any $g\neq g^{\prime}$, $j=1,\cdots,n_{g}$, and $\ell=1,\cdots,n_{g^{\prime}}$. • The data is generated according to the model described through $\text{\eqref{eq:estimand}}$-$\text{\eqref{eq:cond_cov_model}}$. • The variables $X_{gj}$ are identically distributed across all $g$ and $j$, possessing a common marginal density $f(x)$. For any $\underline{n}_{g}\in\{2,3,4\}$, and for any cluster $g$ with $n_{g}\geq\underline{n}_{g}$, the random vector $\left(X_{gj_{1}}^{(\mathrm{ind})},\cdots,X_{gj_{\underline{n}_{g}}}^{(\mathrm{ind})};X_{g}^{(\mathrm{cls})}\right)$ is identically distributed across all $g$ and $j_{1},\dots,j_{\underline{n}_{g}}$, with a common joint density represented by: \[ f_{\underline{n}_{g}}\left(x_{1}^{(\mathrm{ind})},\cdots,x_{\underline{n}_{g}}^{(\mathrm{ind})};x^{(\mathrm{cls})}\right). \] \end{enumerate}
remThe conditions in Assumption $\text{\ref{assu:dgp}}$ (iii) for $f(x)$ and $f_{2}\left(x_{1}^{(\mathrm{ind})},x_{2}^{(\mathrm{ind})};x^{(\mathrm{cls})}\right)$ are sufficient for their consistent estimation. On the other hand, since we are not interested in estimating $f_{3}\left(x_{1}^{(\mathrm{ind})},x_{2}^{(\mathrm{ind})},x_{3}^{(\mathrm{ind})};x^{(\mathrm{cls})}\right)$ and $f_{4}\left(x_{1}^{(\mathrm{ind})},x_{2}^{(\mathrm{ind})},x_{3}^{(\mathrm{ind})},x_{4}^{(\mathrm{ind})};x^{(\mathrm{cls})}\right)$, the associated conditions in Assumption $\text{\ref{assu:dgp}}$ (iii) could be weakened. For a detailed discussion, refer to Appendix $\text{\ref{sec:Technical-discussion}}$.
remIn nonparametric regressions, unobserved cluster heterogeneity is equivalent to a mixture structure. Consider a scenario where the true data-generating process is defined as follows: \begin{align*} Y_{gj} & =m\left(X_{gj},U_{g}\right)+e_{gj},\\ \mathbb{E}\left[e_{gj}\mid\mathbf{X}_{g},U_{g}\right] & =0, \end{align*} where $U_{g}$ is an unobserved cluster-level variable. The critical condition here is that $U_{g}$ and $e_{gj}$ are separable, and $U_{g}$ is exogenous. Under these conditions, the estimand, derived through the law of iterated expectations, is expressed as: \begin{align*} m\left(X_{gj}\right) & =\mathbb{E}\left[Y_{gj}\mid\mathbf{X}_{g}\right]=\mathbb{E}\left[\mathbb{E}\left[Y_{gj}\mid\mathbf{X}_{g},U_{g}\right]\mid\mathbf{X}_{g}\right]\\ & =\mathbb{E}\left[m\left(X_{gj},U_{g}\right)\mid\mathbf{X}_{g}\right]=\int m\left(X_{gj},U_{g}\right)f_{U_{g}\mid\mathbf{X}_{g}}(U_{g}\mid\mathbf{X}_{g})\mathrm{d}U_{g}. \end{align*} This formulation implies that $m\left(X_{gj}\right)$ is essentially a mixture of $m\left(X_{gj},U_{g}\right)$, integrated over the unknown conditional density $f_{U_{g}\mid\mathbf{X}_{g}}(U_{g}\mid\mathbf{X}_{g})$. Additionally, the condition $\mathbb{E}\left[e_{gj}\mid\mathbf{X}_{g},U_{g}\right]=0$ ensures $\mathbb{E}\left[e_{gj}\mid\mathbf{X}_{g}\right]=0$, allowing us to treat $m\left(X_{gj}\right)$ as homogeneous across clusters without loss of generality. \\ Similarly, consider a scenario where the true density of $X_{gj}$ exhibits cluster heterogeneity, represented by the marginal density $f_{X,V_{g}}(X_{gj},V_{g})$, with $V_{g}$ being an unobserved cluster-level variable. In this context, our estimand becomes a mixture of $f_{X,V_{g}}(X_{gj},V_{g})$, which can be formally expressed as: \[ f(X_{gj})=\int f_{X,V_{g}}\left(X_{gj},V_{g}\right)f(V_{g})\mathrm{d}V_{g}. \] This integral representation implies that the regressors possess identical marginal distributions across clusters. Analogously to the treatment of marginal densities, cluster heterogeneities within joint densities can be conceptualized as mixture structures.
remAlthough the majority of research on cluster sampling treats cluster sizes as deterministic, as does this paper, bugni2022inference treat cluster sizes as a random variable in a cluster-level randomized experiment setup. Their investigation primarily focuses on estimating treatment effects across clusters of varying sizes and developing inference methods that account for the randomness of cluster sizes.\footnote{An important limitation of assuming deterministic cluster sizes is that it is difficult to incorporate cluster size effects into the nonparametric regression function. One practical approach is to approximate these effects by deterministically binning cluster sizes (e.g., categorizing clusters into “large” size cluster group with $n_{g}\geq20$, “intermediate” size cluster group with $10\leq n_{g}<20$, and “small” size cluster group with $n_{g}<10$). We can estimate the nonparametric regression separately for each group if each group contains a sufficient number of clusters.} This methodological divergence stems from differing concepts of the data-generating process. bugni2022inference address scenarios where researchers sample clusters in an experiment, viewing cluster sizes as one of the attributes. abadie2023should propose an alternate sampling framework wherein clusters are sampled from a larger population of cluster, followed by the sampling of individuals from these selected clusters' subpopulations.\footnote{bugni2022inference and abadie2023should adopt a design-based approach with a finite population, whereas our paper takes a model-based approach with a hyperpopulation. These two approaches consider different sources of randomness. Please refer to the next footnote for further details.} Deterministic cluster sizes, as assumed in our paper, are justified in two ways. First, if the researcher specifies target cluster sizes ex-ante and conducts a survey to draw $\left(Y_{gj},X_{gj}\right)$ from a hyperpopulation, then cluster sizes can be considered nonrandom. Some survey samplings use this type of procedure (e.g., sampling exactly 20 households from each state). See cochran1977sampling (cochran1977sampling, Chapter 9) for details. Second, even if the first justification does not apply, we can treat cluster sizes as nonrandom by conditioning each theoretical result on the realized cluster sizes $\{n_{g}\}_{g=1}^{G}$. In this way, the researcher can use our model-based approach when cluster sizes are random. This perspective is often used in a model-based approach, where the focus is on the data generated given the observed cluster sizes.
remThis research assumes that the researcher knows the appropriate level of clustering. However, in practice, one has to choose the level of cluster. For example, in terms of the regional cluster level, one may need to choose among zip code, city, county, or state levels. One approach is to assume the structure of the error term, such as cluster random effects, at the most plausible level. See mackinnon2022cluster (mackinnon2022cluster, Section 3.3) for further discussion.\footnote{Our paper adopts a model-based approach, where the source of randomness is the data-generating process. Hence, the arguments on cluster level by abadie2023should are not directly applicable to this paper because they consider a design-based approach, where the sources of randomness are treatment assignment uncertainty and sampling uncertainty. Specifically, the design-based approach usually treats the population error term as fixed. The model-based approach is also useful in (quasi-)experiment setting. For example, eckles2020noise provide justifications of identification in regression discontinuity designs using a model-based approach. They assume that the running variable is a measure of some latent variable with exogenous measurement error.}

Nonparametric density estimation

In this section, we show the consistency of nonparametric density estimators. In this paper, we will use kernel functions satisfying the following definitions.

defnA univariate kernel function $k:\mathbb{R}\rightarrow\mathbb{R}$ is defined to satisfy the following criteria: \begin{enumerate} • $0\leq k(u)\leq\overline{k}<\infty$. • $k(u)=k(-u)$. • $\int_{-\infty}^{\infty}k(u)\mathrm{d}u=1$. • $\kappa_{2}\equiv\int_{-\infty}^{\infty}u^{2}k(u)\mathrm{d}u<\infty$ and $\int_{-\infty}^{\infty}u^{4}k(u)\mathrm{d}u<\infty$. \end{enumerate}
defnA multivariate kernel function $K:\mathbb{R}^{d}\rightarrow\mathbb{R}$ is constructed as the product of univariate kernel functions across dimensions, \[ K\left(X\right)=\prod_{q=1}^{d}k\left(X^{(q)}\right), \] where $k(\cdot)$ is a univariate kernel function and $X^{(q)}$ is the $q$-th component of $X$. The upper bound of the multivariate kernel is $K\left(X\right)\leq\overline{k}^{d}\equiv\overline{K}$.\footnote{Without loss of generality, we assume $\overline{k}\geq1$.}

The kernel density estimator for $f(x)$ is:

equation[equation omitted — 141 chars of source]

where $h>0$ is a bandwidth.

remThe kernel density estimator given in $\text{\eqref{eq:f_hat}}$ can be rewritten as $\widehat{f}(x)=\frac{1}{nh^{d}}\sum_{i=1}^{n}K\left(\frac{X_{i}-x}{h}\right)$ as in the i.i.d. case. Thus, at least for the estimation, we can use a standard software package. This also applies to nonparametric regression.

For the sake of simplicity, our discussion will focus on scenarios where a single bandwidth is used for all components of $X$. However, our theory can be generalized to accommodate multivariate bandwidths by substituting $h$ with a bandwidth matrix, as discussed by ruppert1994multivariate.

assumption
enumerate$nh^{d}\rightarrow\infty$. • $h\rightarrow0$ and $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$. • There exists some neighborhood $\mathcal{N}$ of $x=\left(x^{(\mathrm{ind})\top},x^{\mathrm{(cls)}\top}\right)^{\top}$ such that $f(x)$ is twice continuously differentiable and $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ is continuously differentiable.
remAssumption $\text{\ref{assu:f}}$ (ii) notably extends the i.i.d. case to cluster-dependent settings, introducing a novel condition for bandwidth in the presence of cluster heterogeneity. This condition necessitates a more cautious selection of bandwidth under cluster sampling, balancing the need for $nh^{d}\rightarrow\infty$ against the constraint of $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$. The condition $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$ requires that the maximum cluster size is not growing faster than the shrinking speed of the $h$ neighborhood for the individual-level regressors.\\ Furthermore, Assumption $\text{\ref{assu:f}}$ (iii) underscores the importance of smoothness in both marginal and joint densities within clusters, emphasizing the need for careful examination of density shapes affecting within-cluster observation relationships.\\ To be precise, Assumption $\text{\ref{assu:f}}$ (iii) means that $f(\widetilde{x})$ is twice continuously differentiable at any $\widetilde{x}\in\mathcal{N}$ and $f_{2}\left(\widetilde{x}_{1}^{\mathrm{(ind)}},\widetilde{x}_{2}^{\mathrm{(ind)}};\widetilde{x}^{\mathrm{(cls)}}\right)$ is continuously differentiable at any $\left(\widetilde{x}_{1}^{(\mathrm{ind})\top},\widetilde{x}^{\mathrm{(cls)}\top}\right)^{\top}$, $\left(\widetilde{x}_{2}^{(\mathrm{ind})\top},\widetilde{x}^{\mathrm{(cls)}\top}\right)^{\top}\in\mathcal{N}$. Assumption $\text{\ref{assu:f}}$ (iii) limits our analysis to interior points. Although we focus on interior points $x$, the results could be extended to boundary points.
rem$nh^{d}\rightarrow\infty$ and $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$ together imply that $\left(\max_{g\leq G}n_{g}\right)/n\rightarrow0$, which is a key assumption of hansen2019asymptotic for parametric models under cluster sampling. Moreover, $\left(\max_{g\leq G}n_{g}\right)/n\rightarrow0$ implies $G\rightarrow\infty$. Thus, our theory requires $G\rightarrow\infty$ implicitly. If we only have the bounded size of clusters $\max_{g\leq G}n_{g}=O(1)$, then, $n$ has the same asymptotic order as $G$.
thm(Pointwise consistency) Suppose that Assumptions (ref) and (ref) hold. Then, $\widehat{f}(x)\overset{p}{\rightarrow}f(x)$.
remBeyond pointwise consistency, it is possible to derive expressions for the asymptotic conditional bias and variance, as well as establish the asymptotic normality of $\widehat{f}(x)$. These derivations, while omitted for brevity, follow directly from analogous proofs for the Nadaraya-Watson estimator discussed subsequently.

Nadaraya-Watson estimator

In this section, we derive an asymptotic theory for the Nadaraya-Watson estimator (a.k.a. local constant estimator) for estimating the conditional expectation $\mathbb{E}\left[Y_{gj}\mid X_{gj}=x\right]$. The estimator is:

equation[equation omitted — 207 chars of source]
assumption
enumerate• The density function is strictly positive at $x$, $f(x)>0$. • There exists some neighborhood $\mathcal{N}$ of $x=\left(x^{(\mathrm{ind})\top},x^{\mathrm{(cls)}\top}\right)^{\top}$ such that $m(x)$ and $f(x)$ are twice continuously differentiable, $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ is continuously differentiable, and $f_{3}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, $f_{4}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, $\sigma^{2}(x)$, and $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are continuous.
remAssumption $\text{\ref{assu:nw}}$ (i) is standard for the Nadaraya-Watson estimator. Assumption $\text{\ref{assu:nw}}$ (ii) generalizes the assumption for the i.i.d. case. It requires smoothness for joint densities of observations within the same cluster and the conditional covariance as well as the marginal density and the conditional variance.\\
thm(Asymptotic bias) Suppose that Assumptions (ref)-(ref) hold. Then, \[ \mathbb{E}\left[\hat{m}_{\mathrm{nw}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]=m(x)+h^{2}B_{\mathrm{nw}}(x)+o_{p}\left(h^{2}\right)+O_{p}\left(\sqrt{\frac{1}{nh^{d-2}}}\right), \] where \[ B_{\mathrm{nw}}(x)=\kappa_{2}\sum_{q=1}^{d}\left(\frac{1}{2}\partial_{qq}m(x)+f(x)^{-1}\partial_{q}f(x)\partial_{q}m(x)\right), \] $\partial_{q}f(x)=\partial f(x)/\partial x^{(q)}$, $\partial_{q}m(x)=\partial m(x)/\partial x^{(q)}$, and $\partial_{qq}m(x)=\partial^{2}m(x)/\partial\left(x^{(q)}\right)^{2}$.

We use the following assumption to derive the asymptotic variance.

assumption$\left(\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}\right)h^{d_{\mathrm{ind}}}\rightarrow\lambda\in[0,\infty)$.
rem$\left(\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}\right)h^{d_{\mathrm{ind}}}=O(1)$ is implied by $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$ since $\sum_{g=1}^{G}n_{g}=n$. Assumption (ref) guarantees its convergence.
thm(Asymptotic variance) Suppose that Assumptions (ref)-(ref) hold. Then, \begin{eqnarray} & & \operatorname{Var}\left[\hat{m}_{\mathrm{nw}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]\nonumber \\ & & \qquad=\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)nh^{d}}+\frac{\lambda R_{k}^{d_{\mathrm{cls}}}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{f(x)^{2}nh^{d}}+o_{p}\left(\frac{1}{nh^{d}}\right), \end{eqnarray} where $R_{k}=\int_{-\infty}^{\infty}k\left(u\right)^{2}\mathrm{d}u$. In particular, if $\lambda=0$, \[ \operatorname{Var}\left[\hat{m}_{\mathrm{nw}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]=\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)nh^{d}}+o_{p}\left(\frac{1}{nh^{d}}\right). \]

In the special case of $\lambda=0$, the asymptotic conditional variance is equivalent to the i.i.d. case. A sufficient condition for $\lambda=0$ is $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=o(1)$. In a finite sample, it is more precise to consider $\lambda>0$. The sign of the second term of $\text{\eqref{eq:asy_cond_var}}$ depends on the sign of $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$. In economic applications, it usually takes a positive value, indicating positive conditional covariance of error terms within clusters. Neglecting this term will lead to under-coverage in empirical applications.

remThe pivotal condition for this theorem is Assumption (ref). Note that we can calculate $\left(\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}\right)h^{d_{\mathrm{ind}}}$ directly. The part $\left(\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}\right)$ can be interpreted as follows. Although we are considering deterministic cluster sizes $n_{g}$, the value $\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}=\left(\frac{1}{G}\sum_{g=1}^{G}n_{g}^{2}\right)/\left(\frac{n}{G}\right)$ can be interpreted as the second moment of the cluster sizes over the first moment of the cluster sizes “$\mathbb{E}\left[n_{g}^{2}\right]/\mathbb{E}\left[n_{g}\right]$”, where expectations are taken over $\left\{ n_{g}\right\} _{g=1}^{G}$.
remIn the following two special cases, the second term of $\text{\eqref{eq:asy_cond_var}}$ has a simpler form. Firstly, if we assume the conditional independence $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}}\mid x^{\mathrm{(cls)}}\right)=f\left(x^{\mathrm{(ind)}}\mid x^{\mathrm{(cls)}}\right)^{2}$, $\text{\eqref{eq:asy_cond_var}}$ simplifies to $\lambda R_{k}^{d_{\mathrm{cls}}}\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)/\left(f\left(x^{\mathrm{(cls)}}\right)nh^{d}\right)$. Secondly, if we assume the independence between individual and cluster-level regressors (or assume that there are no cluster-level regressors, $d_{\mathrm{cls}}=0$), $\text{\eqref{eq:asy_cond_var}}$ simplifies to \[ \frac{\lambda R_{k}^{d_{\mathrm{cls}}}\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)f\left(x^{\mathrm{(ind)}}\mid x^{\mathrm{(ind)}}\right)}{f\left(x\right)nh^{d}} \] (or $\lambda\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}}\right)f\left(x^{\mathrm{(ind)}}\mid x^{\mathrm{(ind)}}\right)/\left(f\left(x^{\mathrm{(ind)}}\right)nh^{d}\right),$ respectively).
thm(Pointwise consistency) Suppose that Assumptions (ref)-(ref) hold. Then, \begin{equation} \widehat{m}_{\mathrm{nw}}\left(x\right)\overset{p}{\rightarrow}m\left(x\right). \end{equation}
assumption$ $ \begin{enumerate} • There exists some $r\geq2$ such that \begin{enumerate} • for any $\widetilde{x}=\left(\widetilde{x}^{(\mathrm{ind})\top},\widetilde{x}^{\mathrm{(cls)}\top}\right)^{\top}\in\mathcal{N}$, \begin{equation} \mathbb{E}\left[|e|^{2r}\mid X=\widetilde{x}\right]\leq\overline{v}^{2}<\infty, \end{equation} • for some constant $C>0$, \begin{equation} \frac{\left(\sum_{g=1}^{G}n_{g}^{r}\right)^{1/r}}{n^{1/4}}\leq C<\infty, \end{equation} • and \begin{equation} \frac{1}{n^{r/2}h^{dr-d}}=O(1). \end{equation} \end{enumerate} • We also assume \begin{equation} nh^{d+4}=O(1), \end{equation} \[ R_{k}^{d}f(x)\sigma^{2}(x)+\lambda R_{k}^{d_{\mathrm{cls}}}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)>0, \] and \begin{equation} \max_{g\leq G}\frac{n_{g}^{4}}{n}\rightarrow0 \end{equation} as $n\rightarrow\infty$. \end{enumerate}
thm(Asymptotic Normality) Suppose that Assumptions (ref)-(ref) hold. Then, \begin{eqnarray} & & \sqrt{nh^{d}}\left(\widehat{m}_{\mathrm{nw}}(x)-m(x)-h^{2}B_{\mathrm{nw}}(x)\right)\nonumber \\ & & \qquad\overset{d}{\longrightarrow}\mathrm{N}\left(0,\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)}+\frac{\lambda R_{k}^{d_{\mathrm{cls}}}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{f(x)^{2}}\right). \end{eqnarray}

The asymptotic distribution has the same bias and the same convergence rate as in the i.i.d. case. The asymptotic variance is a scaled value of the primal terms of asymptotic conditional variance that include the conditional covariance term due to the cluster dependence. Our simulation in Section $\text{\ref{sec:Monte-Carlo-simulation}}$ shows the importance of considering this term in inference.

The asymptotic variance in the previous literature with bounded cluster sizes (e.g., bhattacharya2005asymptotic) has only the first term of $\text{\eqref{eq:nw_asydist}}$. Under bounded cluster sizes, cluster dependence is asymptotically negligible since an observation in the $g$-th cluster has a negligible number of observations belonging to the same cluster around the local neighborhood. On the other hand, under growing cluster sizes $n_{g}\rightarrow\infty$, the observation could have a non-negligible number of neighboring observations belonging to the same cluster. Thus, the conditional covariance of error terms matters in our general setup.

Theorem $\text{\ref{thm:nw_asy_dist}}$ is an asymptotic result that holds pointwise-in-the-underlying distribution. Consequently, the asymptotic bias pertains to a specific data-generating process, which influences how it should be used for bandwidth selection (see Remark $\text{\ref{rem:uniformity}}$ for derails). Also, Theorem $\text{\ref{thm:nw_asy_dist}}$ does not provide guidance on how the asymptotic bias should be addressed in inference. Remark $\text{\ref{rem:bias_handling}}$ discusses a practical approach for handling this issue in inference.

remConditions $\text{\eqref{eq:e^r}}$ and $\text{\eqref{eq:nh^5}}$ are standard in the kernel regressions. Replacing $\text{\eqref{eq:nh^5}}$ by $nh^{d+4}=o(1)$ eliminates the asymptotic bias (undersmoothing). Conditions $\text{\eqref{eq:n_g/n_bound}}$ and $\text{\eqref{eq:n_g^4/(nhs)}}$ require smaller cluster sizes than conditions in hansen2019asymptotic. Indeed, they require $\left(\sum_{g=1}^{G}n_{g}^{r}\right)^{1/r}/n^{1/2}\leq C<\infty$ and $\max_{g\leq G}n_{g}^{2}/n\rightarrow0$, which are implied by $\text{\eqref{eq:n_g/n_bound}}$ and $\text{\eqref{eq:n_g^4/(nhs)}}$. \\ Condition $\text{\eqref{eq:r_bound}}$ is not strict if regressors have small dimension $d$. For example, the AIMSE-optimal bandwidth in Section $\text{\ref{sec:Bandwidth-selection}}$ satisfies $nh^{d+4}$ is bounded away from zero. In this case, $\text{\eqref{eq:r_bound}}$ is always satisfied if $d\leq4$ and equivalent to $r\leq2d/(d-4)$ if $d>4$.

Local linear estimator

In this section, we consider the local linear estimator

equation[equation omitted — 136 chars of source]

where

align*[align* omitted — 660 chars of source]

and $K_{h}\left(\cdot\right)=\frac{1}{h^{d}}K\left(\frac{\cdot}{h}\right)$. We will assume an additional condition for the simplicity of proofs.

assumption$K$ has a compact support.
remAssumption $\text{\ref{assu:LL}}$ is a standard technical assumption for local linear estimators. It can be replaced by a tail decay assumption for $K$ (see e.g., fan1992variable).

We can establish similar asymptotic theories for local linear estimators as we derived for Nadaraya-Watson estimators. As in the i.i.d. case, the asymptotic bias of a local linear estimator does not include the term of first-order derivatives.

thm(Asymptotic bias) Suppose that Assumptions (ref)-(ref) and (ref) hold. Then, \[ \mathbb{E}\left[\hat{m}_{\mathrm{LL}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]=m(x)+h^{2}B_{\mathrm{LL}}(x)+o_{p}\left(h^{2}\right), \] where \[ B_{\mathrm{LL}}(x)=\frac{\kappa_{2}}{2}\sum_{q=1}^{d}\partial_{qq}m(x). \]
thm(Asymptotic variance) Suppose that Assumptions (ref)-(ref) and (ref) hold. Then, \begin{eqnarray*} & & \operatorname{Var}\left[\hat{m}_{\mathrm{LL}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]\\ & & \qquad=\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)nh^{d}}+\frac{\lambda R_{k}^{d_{\mathrm{cls}}}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{f(x)^{2}nh^{d}}+o_{p}\left(\frac{1}{nh^{d}}\right). \end{eqnarray*} In particular, if $\lambda=0$, \[ \operatorname{Var}\left[\hat{m}_{\mathrm{LL}}(x)\mid\mathbf{X}_{1},\cdots,\mathbf{X}_{G}\right]=\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)nh^{d}}+o_{p}\left(\frac{1}{nh^{d}}\right). \]
thm(Pointwise consistency) Suppose that Assumptions (ref)-(ref) and (ref) hold. Then, \begin{equation} \widehat{m}_{\mathrm{LL}}\left(x\right)\overset{p}{\rightarrow}m\left(x\right). \end{equation}
thm(Asymptotic normality) Suppose that Assumptions (ref)-(ref) hold. Then, \begin{eqnarray} & & \sqrt{nh^{d}}\left(\widehat{m}_{\mathrm{LL}}(x)-m(x)-h^{2}B_{\mathrm{LL}}(x)\right)\nonumber \\ & & \qquad\overset{d}{\longrightarrow}\mathrm{N}\left(0,\frac{R_{k}^{d}\sigma^{2}(x)}{f(x)}+\frac{\lambda R_{k}^{d_{\mathrm{cls}}}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{f(x)^{2}}\right). \end{eqnarray}

Uniform convergence

If we impose further assumptions, our pointwise consistency result can be strengthened to uniform consistency. Before proving uniform consistency for nonparametric estimators, we will show uniform consistency for the generic function

equation[equation omitted — 145 chars of source]

to its expectation, where $X_{gj}\in\mathbb{R}^{d}$ and $W_{gj}\in\mathbb{R}$.

We assume the cluster samples $\left\{ W_{gj},X_{gj}\right\} $ satisfy the following assumptions.

assumptionThere exists a constant $\overline{V}$ such that \[ \sup_{x}\operatorname{Var}\left(\widehat{\psi}\left(x\right)\right)\leq\frac{\overline{V}}{nh^{d}} \] for sufficiently large $n$.
assumptionFor every $i=1,\dots,n$ and for some $s>2$, we have \begin{equation} \mathbb{E}\left[\left|W_{i}\right|^{s}\right]<B_{1}<\infty \end{equation} and \begin{equation} \sup_{x}\mathbb{E}\left[\left|W_{i}\right|^{s}\mid X_{i}=x\right]f\left(x\right)<B_{2}<\infty. \end{equation} We also assume that \begin{equation} \frac{\left(\max_{g\leq G}n_{g}\right)^{2}\log n}{n^{1-(2/s)}h^{d}}=O(1). \end{equation}
remThe conditions are standard to establish uniform convergence except for $\text{\eqref{eq:theta_logn}}$. Equation $\text{\eqref{eq:theta_logn}}$ has an additional component $\left(\max_{g\leq G}n_{g}\right)^{2}$ in cluster sampling. If we focus on bounded size clusters, $\text{\eqref{eq:theta_logn}}$ can be reduced to the standard assumption for the i.i.d. case.\\ For some applications, $W_{i}$ has a bounded support. In this case, Assumption $\text{\ref{assu:Wgj}}$ is satisfied with $s=\infty$ after rescaling $W_{i}\in[-1,1]$.

We also require a further assumption on the kernel function.

assumptionFor some $0<L<\infty$, $K$ has a compact support, that is, $K(u)=0$ for $\left\Vert u\right\Vert >L$. Furthermore, $K$ is Lipschitz, i.e., for some constant $\Lambda<\infty$ and for all $u,u^{\prime}\in\mathbb{R}$, $\left|K(u)-K\left(u^{\prime}\right)\right|\leq\Lambda\left\Vert u-u^{\prime}\right\Vert $.
thm(Uniform consistency for the general estimator) Suppose that $\left\{ W_{gj},X_{gj}\right\} $ satisfies Assumption $\text{\ref{assu:dgp}}$ and Assumptions $\text{\ref{assu:psi_var}}$, $\text{\ref{assu:Wgj}}$, and $\text{\ref{assu:kernel}}$ hold. Then, for any \begin{equation} c_{n}=O\left(\left(\max_{g\leq G}n_{g}\right)^{2/d}\left(\log n\right)^{1/d}\right) \end{equation} and \begin{equation} a_{n}=\left(\frac{\log n}{nh^{d}}\right)^{1/2}, \end{equation} $\widehat{\psi}\left(x\right)$ converges in probability to $\mathbb{E}\left[\widehat{\psi}\left(x\right)\right]$ uniformly on $\left\Vert x\right\Vert \leq c_{n}$, i.e., \begin{equation} \sup_{\left\Vert x\right\Vert \leq c_{n}}\left|\widehat{\psi}\left(x\right)-\mathbb{E}\left[\widehat{\psi}\left(x\right)\right]\right|=O_{p}\left(a_{n}\right), \end{equation} as $nh^{d}\rightarrow\infty$, $h\rightarrow0$, and $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$.

The proof for Theorem $\text{\ref{thm:psi_unifconv}}$ relies on the following cluster sampling version of Bernstein's inequality, which could be of independent interest.

lem(Bernstein's inequality for cluster sampling) For random variables under cluster sampling $\left\{ \left\{ Y_{gj}\right\} _{j=1}^{n_{g}}\right\} _{g=1}^{G}$ with bounded ranges $[-B,B]$ and zero means, \[ \mathbb{P}\left[\left|\widetilde{\mathbf{Y}}_{1}+\cdots+\widetilde{\mathbf{Y}}_{G}\right|>\varepsilon\right]\leq2\exp\left\{ -\frac{1}{2}\frac{\varepsilon^{2}}{v+\left(\max_{g\leq G}n_{g}\right)B\varepsilon/3}\right\} \] for every $\varepsilon>0$ and $v\geq\operatorname{Var}\left(\widetilde{\mathbf{Y}}_{1}+\cdots+\widetilde{\mathbf{Y}}_{G}\right)$, where $\widetilde{\mathbf{Y}}_{g}=\sum_{j=1}^{n_{g}}Y_{gj}$.

Based on Theorem $\text{\ref{thm:psi_unifconv}},$ we will show the uniform consistency of the nonparametric density estimator and nonparametric regressions. It requires the following conditions, including uniform smoothness.

assumption
enumerate$nh^{d}\rightarrow\infty$. • $h\rightarrow0$ and $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$. • $m(x)$ and $f(x)$ have uniformly continuous second-order derivatives and they are uniformly bounded up to second-order derivatives, $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ has uniformly continuous first-order derivative and is uniformly bounded up to first-order derivative, and $f_{3}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, $f_{4}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, $\sigma^{2}(x)$, and $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are uniformly continuous and uniformly bounded.
thm(Uniform consistency for the nonparametric density estimator) Suppose that Assumptions $\text{\ref{assu:dgp}}$, $\text{\ref{assu:kernel}}$, and (ref) hold. We also assume that \[ \frac{\left(\max_{g\leq G}n_{g}\right)^{2}\log n}{nh^{d}}=O(1). \] Then, for any sequence $c_{n}$ satisfying the condition $\eqref{eq:cn}$, \begin{equation} \sup_{\left\Vert x\right\Vert \leq c_{n}}\left|\widehat{f}\left(x\right)-f\left(x\right)\right|=O_{p}\left(a_{n}+h^{2}\right). \end{equation}
thm(Uniform consistency for the Nadaraya-Watson estimator) Suppose that the assumptions for Theorem $\text{\ref{thm:density_unifconv}}$ hold. We also also assume that Assumption $\text{\ref{assu:Wgj}}$ holds for the cluster observations $\left\{ Y_{gj},X_{gj}\right\} $. If $c_{n}$ is a sequence satisfying the condition $\eqref{eq:cn}$, \begin{equation} \delta_{n}=\inf_{\left\Vert x\right\Vert \leq c_{n}}f(x)>0, \end{equation} and \[ \delta_{n}^{-1}\left(a_{n}+h^{2}\right)=o(1), \] then, \begin{equation} \sup_{\left\Vert x\right\Vert \leq c_{n}}\left|\widehat{m}_{*}\left(x\right)-m\left(x\right)\right|=O_{p}\left(\delta_{n}^{-1}\left(a_{n}+h^{2}\right)\right) \end{equation} for $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{nw}}(x)$ or $\widehat{m}_{\mathrm{LL}}(x)$.

The range $\left\{ x:\left\Vert x\right\Vert \leq c_{n}\right\} $ expands slowly to $\mathbb{R}^{d}$ since our condition $\text{\eqref{eq:cn}}$ can cover a sequence $\left\{ c_{n}\right\} $ such that $c_{n}\rightarrow\infty$ slowly as $n\rightarrow\infty$. This expansion is useful to establish asymptotic theories for semiparametric estimation with a nonparametric kernel estimator in the first-stage.

Suppose that $c_{n}=c$ (constant) and $\delta_{n}$ is far away zero. Then, the uniform convergence rate for kernel regressions is $a_{n}+h^{2}=\left(\log n/(nh^{d})\right)^{1/2}+h^{2}$. By choosing $h=\left(\log n/n\right)^{1/(d+4)}$, the optimal rate $\ensuremath{\left(\log n/n\right)^{2/(d+4)}}$ is attained. This convergence rate is equivalent to stone1982optimal's optimal rate in the i.i.d. case.

Bandwidth selection

In this section, we provide guidelines for selecting bandwidth in nonparametric regressions. We suggest three types of methods: the asymptotic integrated mean squared error (AIMSE) optimal bandwidth selection, the cluster-robust rule-of-thumb, and the cluster-robust cross-validation.

AIMSE-optimal bandwidth

Let $B_{*}(x)=B_{\mathrm{nw}}(x)$ or $B_{\mathrm{LL}}(x)$. The asymptotic integrated mean squared error of the estimator $\widehat{m}_{*}\left(x\right)$ is

eqnarray[eqnarray omitted — 662 chars of source]

where $w(x)$ is some integrable weight function which ensures that $\overline{B}\equiv\int_{\mathbb{R}^{d}}B_{*}(x)^{2}f(x)w(x)\mathrm{d}x$, $\overline{\sigma}^{2}\equiv\int_{\mathbb{R}^{d}}\sigma^{2}(x)w(x)\mathrm{d}x$, and \[ \overline{\sigma}_{\mathrm{cls}}\equiv\int_{\mathbb{R}^{d}}\frac{f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{f(x)}w(x)\mathrm{d}x \] are finite. We define

equation[equation omitted — 122 chars of source]

as an objective function for bandwidth selection since the third term in $\text{\eqref{eq:aimse_derivation}}$ does not depend on $h$ and the fourth term in $\text{\eqref{eq:aimse_derivation}}$ is asymptotically negligible.

thmThe AIMSE-optimal bandwidth that minimizes the AIMSE $\text{\eqref{eq:aimse}}$ is \begin{equation} h_{0}=\left(\frac{dR_{k}^{d}\overline{\sigma}^{2}}{4\overline{B}}\right)^{1/(d+4)}n^{-1/(d+4)}. \end{equation}

Our asymptotic theorems rely on the assumption $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$.\\ When $\left(\max_{g\leq G}n_{g}\right)n^{-d_{\mathrm{ind}}/(d+4)}\rightarrow\infty$, the AIMSE-optimal $h_{0}$ does not satisfy this order. In this case, the AIMSE-optimal bandwidth does not make sense since the AIMSE criterion itself relies on the assumption $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$. Thus, when the largest cluster size is large compared to the sample size $n$, we recommend using the cross-validation criterion (see Section $\text{\ref{subsec:Cross-validation}}$).

remThis paper treats the data-generating process as fixed and considers asymptotic bias as pointwise-in-the-underlying distribution. An caveat of this pointwise-in-the-underlying distribution is that it permits the selection of a kernel function with no asymptotic bias while simultaneously choosing an arbitrarily large bandwidth to reduce variance, as discussed in Tsybakov2009 (Tsybakov2009, Chapter 1.2.4). Consequently, the optimality of the bandwidth proposed in this paper is guaranteed solely for the underlying distribution. armstrong2018optimal argue that the pointwise optimal bandwidth performs poorly over a class of data-generating processes, both analytically and numerically.

Rule-of-thumb

In practice, it is not easy to compute the AIMSE-optimal bandwidth since $\text{\eqref{eq:h0}}$ contains unknown parameters. As suggested by fan1996local (fan1996local, Section 4.2) for the i.i.d. case, we provide a cluster-robust Rule-of-Thumb (CR-ROT) bandwidth choice for a one-dimensional individual-level regressor $x\in\mathbb{R}$. This bandwidth could be a crude estimator of the AIMSE-optimal bandwidth, but the primary purpose of it is to give a guess of the bandwidth requiring little computational effort. Let

equation[equation omitted — 108 chars of source]

be a fitted 4th-order global polynomial regression leaving out the $g$-th cluster. Given this parametric model and a user-specified integrable weight function $w(x)$, the CR-ROT bandwidth is calculated by

equation[equation omitted — 134 chars of source]

where

eqnarray*[eqnarray* omitted — 493 chars of source]

and $\check{e}_{gj}=Y_{gj}-\check{m}_{-g}\left(X_{gj}\right)$. In words, $\check{B}$ and $\check{\sigma}^{2}$ are computed by the parametric model $\text{\eqref{eq:global-g}}$ and the homoskedastic standard error assumption for local linear estimators. For Nadaraya-Watson estimators, we also assume that $X$ has a uniform distribution for simplicity. Then, we have $f^{\prime}(x)=0$ and can compute $\bar{B}$ as for local linear estimators by $B_{\text{nw}}(x)=B_{\text{LL}}(x)$. A common choice of $w(x)$ is an indicator function of some interval.

Equation $\text{\eqref{eq:CR-ROT}}$ is different from the standard Rule-of-Thumb (ROT) bandwidth choice by fan1996local since it uses $\check{m}_{-g}(x)$ instead of $\check{m}(x)$, which is estimated by the full sample. We use $\check{m}_{-g}(x)$ to eliminate dependence between the estimator $\check{m}_{-g}(\cdot)$ and $\left(Y_{gj},X_{gj}\right)$. This modification should provide a better estimation of out-of-sample prediction error.

Cross-validation

A heuristic cross-validation function for clustered sampling is

equation[equation omitted — 145 chars of source]

where $\widetilde{e}_{gj}=Y_{gj}-\widetilde{m}_{-g}\left(X_{gj},h\right)$, and $\widetilde{m}_{-g}\left(X_{gj},h\right)$ is the leave-one-cluster-out nonparametric estimator computed with bandwidth $h$ and without cluster $g$. For example, hansen2022econometrics (hansen2022econometrics, Section 19.20) suggests this form of cross-validation, but he does not provide any theoretical guarantees. For Nadaraya-Watson estimators, the leave-one-cluster-out nonparametric estimator is defined by

equation[equation omitted — 287 chars of source]

Similarly, for local linear estimators, the leave-one-cluster-out nonparametric estimator is defined by

equation[equation omitted — 192 chars of source]

where

align*[align* omitted — 218 chars of source]

$\mathbf{X}_{x,-g}$ and $\mathbf{W}_{x,-g}$ are defined by the same way as $\mathbf{X}_{x}$ and $\mathbf{W}_{x}$, but without using the variables in the $g$-th cluster. We will show that this cross-validation criterion works appropriately.

thmLet $\overline{\sigma}_{w}^{2}=\mathbb{E}\left[e_{gj}^{2}w\left(X_{gj}\right)\right]=\mathbb{E}\left[\sigma^{2}\left(X_{gj}\right)w\left(X_{gj}\right)\right]$ and $w(x)$ be some integrable weight function. Under Assumption $\text{\ref{assu:dgp}}$, we can decompose the expectation of the cross-validation function over $\left\{ \mathbf{Y}_{g},\mathbf{X}_{g}\right\} _{g=1}^{G}$ as \begin{equation} \mathbb{E}\left[\mathrm{CV}(h)\right]=\overline{\sigma}_{w}^{2}+\operatorname{IMSE}_{G-1}(h) \end{equation} where \begin{equation} \operatorname{IMSE}_{G-1}(h)\equiv\sum_{g=1}^{G}\frac{n_{g}}{n}\mathbb{E}_{-g}\left[\int_{\mathbb{R}^{d}}\left\{ m\left(x\right)-\widetilde{m}_{-g}\left(x,h\right)\right\} ^{2}f\left(x\right)w\left(x\right)\mathrm{d}x\right], \end{equation} and the last expectation is taken over the sample except for the $g$-th cluster $\left(\mathbf{Y}_{-g},\mathbf{X}_{-g}\right)=\left\{ \mathbf{Y}_{g^{\prime}},\mathbf{X}_{g^{\prime}}\right\} _{g^{\prime}\neq g}$.

Since $\overline{\sigma}_{w}^{2}$ does not depend on $h$, minimizing $\mathbb{E}\left[\mathrm{CV}(h)\right]$ on $h$ is equivalent to minimizing $\operatorname{IMSE}_{G-1}(h)$, which is a sum of the expected mean squared errors weighted by cluster sizes. Thus, this theorem justifies the use of the leave-one-cluster-out cross-validation. We can choose the bandwidth by minimizing a cluster-robust cross-validation function $\mathrm{CV}(h)$ over some finite grid points $H=[h_{1},\cdots,h_{J}]$,

equation[equation omitted — 105 chars of source]

Note that the decomposition theorem holds for finite samples and does not rely on assumptions such as $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$.

A new cluster-robust variance estimation

Since the asymptotic variance of $\text{\eqref{eq:nw_asydist}}$ contains the joint density $f\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, the conditional variance $\sigma^{2}(x)$, and the conditional covariance $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, we need to estimate each of them for inference. Alternatively, calonico2019nprobust and hansen2022econometrics (hansen2022econometrics, Section 19.20) propose to use a finite sample conditional variance of $\widehat{m}\left(X_{gj}\right)$ with estimated error terms as an estimator of the asymptotic variance. To the best of our knowledge, there is no theoretical guarantee of their methods, and this paper is the first research providing asymptotic theories of inference for nonparametric regressions under general cluster sizes.

For the joint density estimation, we propose to use

eqnarray[eqnarray omitted — 501 chars of source]

where $b$ is a bandwidth and $N=\sum_{g:n_{g}\geq2}n_{g}(n_{g}-1)/2$.

The expression $\text{\eqref{eq:joint_density_estimator}}$ can be interpreted as a standard nonparametric density estimator. We estimate the density using $\left(2d_{\mathrm{ind}}+d_{\mathrm{cls}}\right)$-dimensional regressors $\left(X_{gj}^{(\mathrm{ind})\top},X_{g\ell}^{(\mathrm{ind})\top},X_{g}^{\mathrm{(cls)}\top}\right)^{\top}$, thus we have $b^{2d_{\mathrm{ind}}+d_{\mathrm{cls}}}$ in the denominator in $\text{\eqref{eq:joint_density_estimator}}$. For clusters larger than $2$ (i.e., $n_{g}\geq2$), there are $\sum_{1\leq j<\ell\leq n_{g}}1=n_{g}(n_{g}-1)/2$ possible combinations of $X_{gj}^{(\mathrm{ind})}$ and $X_{g\ell}^{(\mathrm{ind})}$. Each cluster has a $n_{g}(n_{g}-1)/2$ effective size observations, and we have the $N=\sum_{g:n_{g}\geq2}n_{g}(n_{g}-1)/2$ effective size sample in total. In these senses, $\text{\eqref{eq:joint_density_estimator}}$ is a standard nonparametric density estimator for $\left(2d_{\mathrm{ind}}+d_{\mathrm{cls}}\right)$-dimensional regressors and $n_{g}(n_{g}-1)/2$ size clusters.

remNote that we use the kernel $K\left(\frac{\left(X_{gj}^{(\mathrm{ind})\top},X_{g\ell}^{(\mathrm{ind})\top},X_{g}^{\mathrm{(cls)}\top}\right)^{\top}-\left(x^{(\mathrm{ind})\top},x^{(\mathrm{ind})\top},x^{\mathrm{(cls)}\top}\right)^{\top}}{b}\right)$ instead of $K\left(\frac{X_{gj}-x}{b}\right)K\left(\frac{X_{g\ell}-x}{b}\right)$. The latter is the kernel to estimate $\left.f_{2^{\prime}}\left(x_{gj},x_{g\ell}\right)\right|_{\left(x_{gj},x_{g\ell}\right)=\left(x,x\right)}$, which is not continuous around $\left(x_{gj},x_{g\ell}\right)=\left(x,x\right)$. Indeed, this joint density is “degenerate” in coordinates of cluster-level regressors.

We make the following assumptions to estimate the joint density consistently.

assumptionDefine $\varsigma^{2}\left(X_{gj}\right)\equiv\mathbb{E}\left[e_{gj}^{4}\mid\mathbf{X}_{g}\right]=\mathbb{E}\left[e_{gj}^{4}\mid X_{gj}\right]$ and \begin{align*} \varsigma\left(X_{gj}^{(\mathrm{ind})},X_{gj}^{(\mathrm{ind})},X_{g\ell}^{(\mathrm{ind})},X_{g\ell}^{(\mathrm{ind})};X_{g}^{(\mathrm{cls})}\right) & \equiv\mathbb{E}\left[e_{gj}e_{g\ell}e_{gt}e_{gs}\mid\mathbf{X}_{g}\right]\\ & =\mathbb{E}\left[e_{gj}e_{g\ell}e_{gt}e_{gs}\mid X_{gj}^{(\mathrm{ind})},X_{g\ell}^{(\mathrm{ind})},X_{gt}^{(\mathrm{ind})},X_{gs}^{(\mathrm{ind})};X_{g}^{(\mathrm{cls})}\right]. \end{align*} \begin{enumerate} • $Nb^{2d_{\mathrm{ind}}+d_{\mathrm{cls}}}\rightarrow\infty$. • $b\rightarrow0$ and $\left(\max_{g\leq G}n_{g}^{2}\right)b^{2d_{\mathrm{ind}}}=O(1)$. • $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)>0$. • There exists some neighborhood $\mathcal{N}$ of $x=\left(x^{(\mathrm{ind})\top},x^{(\mathrm{ind})\top}\right)^{\top}$ such that $\sigma^{2}\left(x\right)$, $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, and $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are twice continuously differentiable, $f_{3}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ and $f_{4}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are continuously differentiable, and $\varsigma^{2}\left(x\right)$ and $\varsigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are continuous. Also, joint densities of up to 8 individual-level regressors and cluster-level regressors within the same cluster follow common distributions, and these joint densities \[ f_{5}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right),\cdots, \] \[ f_{8}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right) \] are continuous on the neighborhood $\mathcal{N}$. • There exits some sequence $\left\{ c_{n}\right\} $ satisfying the condition $\eqref{eq:cn}$ such that for any $g=1,\cdots,G$ and for any $j=1,\cdots,n_{g}$, we have $\left\Vert X_{gj}\right\Vert \leq c_{n}$ with probability approaching one. \end{enumerate}
remAssumption $\text{\ref{assu:condvar}}$ (i) and (ii) correspond to $nh^{d}\rightarrow\infty$, $h\rightarrow0$, and $\left(\max_{g\leq G}n_{g}\right)h^{d_{\mathrm{ind}}}=O(1)$ in the marginal density estimation. Assumption $\text{\ref{assu:condvar}}$ (iii) and (iv) are stronger than Assumption $\text{\ref{assu:nw}}$ so that we can cover regressors $\left(X_{gj}^{(\mathrm{ind})\top},X_{g\ell}^{(\mathrm{ind})\top},X_{g}^{\mathrm{(cls)}\top}\right)^{\top}$ constructed by two observations $X_{gj}$ and $X_{g\ell}$. A sufficient condition for Assumption $\text{\ref{assu:condvar}}$ (v) is $\mathbb{E}\left\Vert X_{gj}\right\Vert <\infty$ since Markov's inequality implies \[ \Pr\left(\left\Vert X_{gj}\right\Vert \geq c_{n}\right)\leq\mathbb{E}\left\Vert X_{gj}\right\Vert /c_{n}\rightarrow0 \] if we choose $c_{n}\rightarrow\infty$.
thm(Consistency of the joint density estimator) Suppose that Assumption $\ref{assu:condvar}$ holds. Then, \[ \widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\overset{p}{\rightarrow}f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right). \]

Next, we will consider conditional variance and covariance estimation. We only provide Nadaraya-Watson type estimators, but they can be easily extended to local linear type ones. Since the goal here is to estimate $\sigma^{2}(x)$, we can estimate it as we did for $m(x)$. The infeasible Nadaraya-Watson estimator is \[ \widehat{\sigma}_{\mathrm{nw}}^{2*}\left(x\right)=\frac{\sum_{g=1}^{G}\sum_{j=1}^{n_{g}}K\left(\frac{X_{gj}-x}{h}\right)e_{gj}^{2}}{\sum_{g=1}^{G}\sum_{j=1}^{n_{g}}K\left(\frac{X_{gj}-x}{h}\right)}, \] This estimator is infeasible because $e_{gj}$ is unknown. We can replace it by $\widehat{e}_{gj}=Y_{gj}-\widehat{m}_{*}\left(X_{gj}\right)$ with $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{nw}}(x)$ or $\widehat{m}_{\mathrm{LL}}(x)$. The feasible variance estimator of the conditional variance is

equation[equation omitted — 244 chars of source]

The following theorem shows $\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ is a consistent estimator.

thm(Consistency of the variance estimator) Let $\widehat{e}_{gj}=Y_{gj}-\widehat{m}_{*}\left(X_{gj}\right)$ and $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{nw}}(x)$ or $\widehat{m}_{\mathrm{LL}}(x)$. Suppose that the assumptions for Theorem $\text{\ref{thm:nw_unifconv}}$ and Assumption $\ref{assu:condvar}$ hold. Then, \begin{equation} \widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)\overset{p}{\rightarrow}\sigma^{2}\left(x\right). \end{equation}

Similar to the joint density estimator, we can construct a Nadaraya-Watson type estimator for the conditional covariance using $\left(2d_{\mathrm{ind}}+d_{\mathrm{cls}}\right)$-dimensional regressors $\left(X_{gj}^{(\mathrm{ind})\top},X_{g\ell}^{(\mathrm{ind})\top},X_{g}^{\mathrm{(cls)}\top}\right)^{\top}$:

eqnarray*[eqnarray* omitted — 693 chars of source]

Because $e_{gj}$ is unknown, it is infeasible as $\widehat{\sigma}_{\mathrm{nw}}^{2*}\left(x\right)$. The feasible version of $\widehat{\sigma}_{\mathrm{nw}}^{2*}$ is estimated by replacing $e_{gj}$ with $\widehat{e}_{gj}=Y_{gj}-\widehat{m}_{*}\left(X_{gj}\right)$,

eqnarray[eqnarray omitted — 739 chars of source]
thm(Consistency of the covariance estimator) Let $\widehat{e}_{gj}=Y_{gj}-\widehat{m}_{*}\left(X_{gj}\right)$ and $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{nw}}(x)$ or $\widehat{m}_{\mathrm{LL}}(x)$. Suppose that the assumptions for Theorem $\text{\ref{thm:nw_unifconv}}$ and Assumption $\text{\ref{assu:condvar}}$ hold. Then, \begin{equation} \widehat{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\overset{p}{\rightarrow}\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right). \end{equation}
corLet $\widehat{\lambda}=\left(\frac{1}{n}\sum_{g=1}^{G}n_{g}^{2}\right)h^{d_{\mathrm{ind}}}$. Let $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{nw}}(x)$ and $B_{*}(x)=B_{\mathrm{nw}}(x)$ (or $\widehat{m}_{*}(x)=\widehat{m}_{\mathrm{LL}}(x)$ and $B_{*}(x)=B_{\mathrm{LL}}(x)$). Suppose that the assumptions for Theorem $\text{\ref{thm:nw_asy_dist}}$ (or Theorem $\text{\ref{thm:LL_asy_dist}}$, respectively), Theorem $\text{\ref{thm:nw_condvar_cons}}$, and Theorem $\text{\ref{thm:nw_condcov_cons}}$ hold. Then, \begin{eqnarray} & & \left(\frac{R_{k}^{d}\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)}{\widehat{f}(x)}+\frac{\widehat{\lambda}R_{k}^{d_{\mathrm{cls}}}\widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\widehat{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)}{\left(\widehat{f}(x)\right)^{2}}\right)^{-1/2}\nonumber \\ & & \times\sqrt{nh^{d}}\left(\widehat{m}_{*}(x)-m(x)-h^{2}B_{*}(x)\right)\nonumber \\ & & \qquad\overset{d}{\longrightarrow}\mathrm{N}\left(0,1\right). \end{eqnarray}

Corollary $\text{\ref{cor:nw_asydist_condvar}}$ suggests to use

equation[equation omitted — 408 chars of source]

as a standard error. The estimator $\widehat{\lambda}R_{k}^{d_{\mathrm{cls}}}\widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)\widehat{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)/\left(\widehat{f}(x)\right)^{2}$ could be too difficult to estimate in practice for the following two main reasons. First, it contains $\widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ and $\widehat{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$, which put most kernel weights for observations that $X_{gj}^{(\mathrm{ind})}$ and $X_{g\ell}^{(\mathrm{ind})}$ are both in the neighborhood of $x^{\mathrm{(ind)}}$. In a finite sample, such observations could be rarely observed, and these estimators could be imprecise. Second, it contains a density ratio $\widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)/\widehat{f}(x)$, which is difficult to estimate, especially nonparametrically.

To overcome these difficulties, we provide a parametric compromise under additional assumptions. We assume that $f_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ follows a multivariate normal distribution, $x^{\mathrm{(ind)}}$ and $x^{\mathrm{(cls)}}$ are independent or there are no cluster-level regressors (see also Remark $\text{\ref{rem:simple_cov}}$), and the conditional covariance is homoskedastic. Then, we can simplify

eqnarray[eqnarray omitted — 581 chars of source]

where $\check{e}_{gj}=Y_{gj}-\check{m}_{-g}\left(X_{gj}\right)$, $\check{m}_{-g}\left(x\right)$ is estimated by the global polynomial regression as $\text{\eqref{eq:global-g}}$, and $p\left(x_{1}\mid x_{2},\mu,\Sigma\right)$ is a conditional density function of $x_{1}$ given $x_{2}$ with the joint distribution $\left(x_{1}^{\top},x_{2}^{\top}\right)^{\top}\sim\mathrm{N}\left(\mu,\Sigma\right)$. We can estimate $\widehat{\mu}=\left(\widehat{\mu}_{1}^{\top},\widehat{\mu}_{1}^{\top}\right)^{\top}$ and $\widehat{\Sigma}=\left(

array[array omitted — 110 chars of source]

\right)^{\top}$ easily by using sample moments. Note that the expectation $\widehat{\mu}_{1}$ and the variance matrix $\widehat{\Sigma}_{11}$ are the same for $x_{1}$ and $x_{2}$ since we initially assumed identical marginal densities in Assumption $(ref)$.

In practice, we can estimate $\sigma^{2}\left(x\right)$ and $\sigma\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ by using clustered-level jackknife estimators. hansen2022jackknife shows that for parametric linear regressions, clustered-level jackknife variance estimators are better than conventional variance estimators with respect to the worst-case bias. Clustered-level jackknife variance estimators $\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ and $\widetilde{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ are estimated by replacing $e_{gj}$ with $\widetilde{e}_{gj}=Y_{gj}-\widetilde{m}_{-g}\left(X_{gj}\right)$, where $\widetilde{m}_{-g}\left(\cdot\right)$ is a nonparametric estimator estimated leaving out the $g$-th cluster observations. In the simulation section, we will compare coverage ratios of confidence intervals constructed by the conventional standard error $\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ and the cluster-robust standard error $\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$.

remThe theorems use the same bandwidth $h$ for $\widehat{m}_{*}(x)$, $\widehat{f}(x)$, and $\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$, and the same bandwidth $b$ for $\widehat{f}_{2}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ and $\widehat{\sigma}_{\mathrm{nw}}\left(x^{\mathrm{(ind)}},x^{\mathrm{(ind)}};x^{\mathrm{(cls)}}\right)$ for notational simplicity. However, we can easily extend these results to the case where different bandwidths are used (denoted by $h_{m},h_{f},h_{\sigma^{2}},b_{f},b_{\sigma}$) as long as $h_{m},h_{f},h_{\sigma^{2}}$ and $b_{f_{2}},b_{\sigma}$ have the same asymptotic orders as $h$ and $b$, respectively.
remBecause the estimator must be centered by the unknown bias $h^{2}B_{*}(x)$ as well as the true value $m(x)$ in $\text{\eqref{eq:asydist_condvar}}$, the bias term should be considered in inference. There are three main ways to handle it. The first way is to ignore it. This ignorance could be justified by an undersmoothing assumption $nh^{d+4}=o(1)$. It is the simplest way but not ideal since the bias exists in a finite sample. Second, in the context of regression discontinuity designs, calonico2014robust suggest estimating $B_{*}(x)$ nonparametrically and using a new standard error to take the randomness due to the bias estimation into account. Third, armstrong2018optimal characterize finite sample optimal confidence intervals with the worst-case bias correction for i.i.d. observations. Comparing these procedures in the cluster dependence case is important, though it is outside of the scope of this paper. For simplicity, this paper uses the undersmoothing bandwidth in simulation and empirical illustration to disregard the asymptotic bias. The practical choice we recommend is $h_{\text{CR-CV}}\times n^{1/5}\times n^{-2/7}$, where $h_{\text{CR-CV}}$ is computed using the cluster-robust cross-validation. The factor $n^{1/5}\times n^{-2/7}$ is included for undersmoothing, as utilized, for example, in chernozhukov2013intersection.

Monte Carlo simulation

In this section, we will check the validity of bandwidth selections and confidence intervals in simulated datasets under cluster sampling. For both simulation studies, we consider the following setup. We fix the number of clusters $G=100$ and cluster sizes $n_{g}=20$ for $g=1,\dots G-1$. To evaluate the effect of the largest cluster size, we try two cluster sizes $n_{G}\in\left\{ 20,100\right\} $ for cluster $g=G$. Thus, we try two scenarios with $\left(\max_{g\leq G}n_{g}\right)/n\approx\left\{ 0.02,0.09\right\} $, also corresponding to homogeneous or heterogeneous size clusters. We generated 2000 datasets for replication. For the data-generating process, the following two models are considered.

Setup 1 (homoskedastic errors):

\[ Y_{gj}=\sin\left(2X_{gj}\right)+2\exp\left(-16X_{gj}^{2}\right)+0.5e_{gj}, \] where $X_{gj}=\sqrt{\rho_{X}}\left(X_{1}\right)_{g}+\sqrt{1-\rho_{X}}\left(X_{2}\right)_{gj}$, $e_{gj}=\sqrt{\rho_{e}}c_{g}+\sqrt{1-\rho_{e}}u_{gj}$, and we generate $\left(X_{1}\right)_{g}\sim\mathcal{N}\left(0,1\right)$, $\left(X_{2}\right)_{gj}\sim\mathcal{N}\left(0,1\right)$, $c_{g}\sim\mathcal{N}\left(0,1\right)$, $u_{gj}\sim\mathcal{N}\left(0,1\right)$ independently. We set $\rho_{X},\rho_{e}\in\{0.2,0.5\}$. Note that larger $\rho_{X}$ and $\rho_{e}$ imply stronger cluster dependence on the regressor and the error term, respectively.

Setup 2 (heteroskedastic errors):

align*[align* omitted — 164 chars of source]

and $X_{gj}$ and $e_{gj}$ are generated in the same way as Setup 1.

A key feature is that Setup 1 has homoskedastic errors, and Setup 2 has heteroskedastic errors. We adopted the functional form $m(\cdot)$ for Setup 1 from fan1992variable and Setup 2 from kai2010local. The data-generating process for $X_{gj}$ and $e_{gj}$ are standard in the cluster dependence literature (cameron2008bootstrap; bartalotti2017regression). We set the weight function $w(x)$ for cross-validation and IAMSE equals to $w(x)=\mathbb{I}\left\{ \xi_{\mathrm{L}}\leq x\leq\xi_{\mathrm{U}}\right\} $, where we set $\xi_{\mathrm{L}}=-1.5$ and $\xi_{\mathrm{U}}=1.5$ for Setup 1, and $\xi_{\mathrm{L}}=0$ and $\xi_{\mathrm{U}}=1$ for Setup 2, respectively. For nonparametric regression, we use the Epachenikov kernel and local linear estimators. Results when using Nadaraya-Watson estimators are presented in Appendix $\text{\ref{sec:Add_sim}}$ because their values are similar to the ones by local linear estimators.

Bandwidth selection

We will compare four methods of bandwidth choice: (i) rule-of-thumb (ROT), (ii) cluster-robust rule-of-thumb (CR-ROT), (iii) cross-validation (CV), and cluster-robust cross-validation (CR-CV). $h_{\text{CR-ROT}}$ (Equation $\text{\ref{eq:CR-ROT}}$) and $h_{\text{CR-CV}}$ (Equation $\text{\ref{eq:h_cv}}$) are what we suggested. The ROT bandwidth choice $h_{\text{ROT}}$ is proposed by fan1996local for i.i.d. observations. Instead of leave-one-cluster-out global fit as $\text{\eqref{eq:global-g}}$ for $h_{\text{CR-ROT}}$, it uses the global fit using the entire sample. $h_{\text{CV}}$ minimizes the cross-validation function. The difference between $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ is that $h_{\text{CV}}$ minimizes a criterion based on leave-one-out prediction errors, while $h_{\text{CR-CV}}$ minimizes a criterion based on leave-one-cluster-out prediction errors.

In simulation, we first compute $h_{\text{ROT}}$ and $h_{\text{CR-ROT}}$. Then, $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ are found by the grid search for $50$ points over $[h_{\text{CR-ROT}}/3,3h_{\text{CR-ROT}}]$. The performance of the methods of bandwidth selection is evaluated by the average squared error (ASE): \[ \operatorname{ASE}(h)=\frac{1}{n_{\text{grid }}}\sum_{k=1}^{n_{\text{grid }}}\left\{ \widehat{m}_{\mathrm{LL}}\left(u_{k},h\right)-m\left(u_{k}\right)\right\} ^{2}, \] where $\widehat{m}_{\mathrm{LL}}\left(u_{k},h\right)$ is the local linear estimator with the bandwidth $h$, and $\text{\ensuremath{\left\{ u_{1},\dots,u_{n_{\text{grid }}}\right\} } }$ are the grid points to evaluate the performance. We set the number of the grid $n_{\text{grid }}=50$ and $\text{\ensuremath{\left\{ u_{1},\dots,u_{n_{\text{grid }}}\right\} } }$ are evenly distributed over $\left[\xi_{\mathrm{L}},\xi_{\mathrm{U}}\right]$.

Tables $\text{\ref{tab:bw_LL1}}$ and $\text{\ref{tab:bw_LL2}}$ show means of the ASE for the local linear estimator and means of selected bandwidths (in curly brackets) across each simulation draw for Setup 1 and 2, respectively. Each table contains four methods of bandwidth choice in several scenarios. We consider combinations of homogeneous or heterogeneous size clusters, high or low cluster dependence on regressors, and high or low cluster dependence on error terms. In Setup 1 (Table $\text{\ref{tab:bw_LL1}}$, homoskedastic errors), $h_{\text{ROT}}$ and $h_{\text{CR-ROT}}$ have similar values of the ASE and the selected bandwidth, and $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ have the similar values of them, but $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ work better than $h_{\text{ROT}}$ and $h_{\text{CR-ROT}}$ in terms of the ASE. Within the same method of bandwidth choice, heterogeneous size clusters $n_{G}=100$ and high cluster dependence on regressors $\rho_{X}=0.5$ give a slightly larger ASE. Compared to them, high cluster dependence on error terms $\rho_{e}=0.5$ gives a much larger ASE.

In Setup 2 (Table $\text{\ref{tab:bw_LL2}}$, heteroskedastic errors), $h_{\text{ROT}}$ and $h_{\text{CR-ROT}}$ work poorly because they assume homoskedasticity. Different from Setup 1, $h_{\text{ROT}}$ has a larger ASE than $h_{\text{CR-ROT}}$. As Setup 1, $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ work well and have similar values of the ASE and the selected bandwidth. The good performance of $h_{\text{CV}}$ can not be explained by our theoretical results. We probably need an asymptotic analysis of $h_{\text{CV}}$ under the cluster dependence, which is outside of the scope of this paper.

table[table omitted — 1,878 chars of source]
table[table omitted — 1,878 chars of source]

To investigate how close the selected bandwidths are to the bandwidth that minimizes the ASE, we plot two figures for a scenario with $n_{G}=100$ and $\rho_{X}=\rho_{e}=0.5$. Figures $\text{\ref{fig:bw_LL1}}$ and $\text{\ref{fig:bw_LL2}}$ have values of bandwidth $h$ in the $x$-axis and means of the function $\mathrm{ASE}(h)$ in the $y$-axis, which are calculated from simulation draws for Setup 1 and 2, respectively. These figures also contain means of selected bandwidths by four selection methods and $h_{\mathrm{argmin}}$ minimizing $\mathrm{ASE}(h)$. We find that $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ are very close to $h_{\mathrm{argmin}}$ in both setups.

figure[figure omitted — 242 chars of source]
figure[figure omitted — 242 chars of source]

We recommend $h_{\text{CR-CV}}$ because it has a theoretical guarantee (Theorem $\text{\ref{thm:cr-cv}}$) and because it performs the best in our simulation, although the difference of ASEs between $h_{\text{CV}}$ and $h_{\text{CR-CV}}$ is subtle. In terms of the computational cost, $h_{\text{CR-CV}}$ is also better than $h_{\text{CV}}$ since leave-one-cluster-out estimators use smaller sample sizes than leave-one-out estimators do. $h_{\text{CR-ROT}}$ is useful for a rough estimation and for choosing the range of the grid search in cross-validation. We recommend $h_{\text{CR-ROT}}$ over $h_{\text{ROT}}$ for these purposes because it has a smaller ASE.

Inference

We will compare three methods to calculate 95% confidence intervals: (i) using the conventional standard error as for i.i.d. datasets ($CI$), (ii) using the cluster-robust standard error without the term related to the conditional covariance ($CI_{\mathrm{CR}}$), and (iii) using the cluster-robust standard error with the term related to the conditional covariance ($CI_{\lambda}$). More precisely, we calculate $CI$ with the standard error $\sqrt{R_{k}^{d}\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)/\left(nh^{d}\widehat{f}(x)\right)}$, $CI_{\mathrm{CR}}$ with the standard error $\sqrt{R_{k}^{d}\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)/\left(nh^{d}\widehat{f}(x)\right)}$, and $CI_{\mathrm{\lambda}}$ with the standard error \[ \sqrt{\frac{1}{nh^{d}}}\sqrt{\frac{R_{k}^{d}\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)}{\widehat{f}(x)}+\frac{\widehat{\lambda}\widehat{f}_{2}\left(x,x\right)\widehat{\sigma}_{\mathrm{nw}}\left(x,x\right)}{\left(\widehat{f}(x)\right)^{2}}}, \] where $\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ and $\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ are nonparametrically estimated with $\widehat{e}_{gj}=Y_{gj}-\widehat{m}_{\mathrm{LL}}\left(X_{gj}\right)$ and $\widetilde{e}_{gj}=Y_{gj}-\widetilde{m}_{\mathrm{LL},-g}\left(X_{gj}\right)$, and $\widehat{\lambda}\widehat{f}\left(x,x\right)\widehat{\sigma}_{\mathrm{nw}}\left(x,x\right)$ is calculated parametrically as $\text{\eqref{eq:cov_simplified}}$. Note that in our data-generating processes, we have no cluster-level regressor $x^{\mathrm{(cls)}}$. In nonparametric regressions, bandwidths are selected as follows. The bandwidth $h_{f}$ for $\widehat{f}\left(x\right)$ is calculated by the reference bandwidth of the Epanechnikov kernel $h_{f}\approx1.049\cdot S_{X}\cdot n^{-1/5}$ where $S_{X}$ is a standard deviation of $X$ (e.g., see li2007nonparametric, Section 1.2). The bandwidth $h_{\sigma^{2}}$ for $\widehat{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ and $\widetilde{\sigma}_{\mathrm{nw}}^{2}\left(x\right)$ is set to $h_{f}$. Choosing $h_{\sigma^{2}}=h_{f}$ is a conventional choice, for example, used by imbens2012optimal. In this simulation, $\ensuremath{\widehat{\lambda}=20\cdot h_{m}}$ for $n_{G}=20$ and $\widehat{\lambda}\approx23.846\cdot h_{m}$ for $n_{G}=100$. To ignore the asymptotic bias, we set the bandwidth for $\hat{m}_{\mathrm{LL}}(x)$ using an undersmoothing approach defined as $h_{m}=h_{\text{CR-CV}}\times n^{1/5}\times n^{-2/7}$, where $h_{\text{CR-CV}}$ is computed using the CR-CV method as outlined in Section $\text{\ref{subsec:sim_bw}}$.

Appendix $\text{\ref{sec:Add_sim}}$ contains results without undersmoothing, where we set $h_{m}=h_{\text{CR-CV}}$. In the appendix, we explore two additional strategies on the bias: an infeasible analytical bias correction using knowledge of the true data-generating process, and simply ignoring the bias term.

The CIs are constructed at $x=0.75$ for Setup 1 and at $x=0.8$ and $0.4$ for Setup 2. Performances of confidence intervals are measured by the coverage ratio across each simulation draw.

Tables $\text{\ref{tab:CI_LL1}}$-$\text{\ref{tab:CI_LL2_0.4}}$ show the coverage ratio for local linear estimators and means of the length of confidence intervals (in curly brackets) across each simulation draw for Setup 1, Setup 2 with $x=0.8$, and Setup 2 with $x=0.4$, respectively. Each table contains results for three types of confidence intervals in several scenarios. As in Section $\text{\ref{subsec:sim_bw}}$, we consider 8 different scenarios with all possible combinations of $n_{G}\in\left\{ 20,100\right\} $, $\rho_{X}\in\{0.2,0.5\}$ and $\rho_{e}\in\{0.2,0.5\}$.

table[table omitted — 1,567 chars of source]
table[table omitted — 1,579 chars of source]
table[table omitted — 1,579 chars of source]

In Setup 1 (Table $\text{\ref{tab:CI_LL1}}$, homoskedastic errors), $CI_{\mathrm{CR}}$ has slightly better coverages than $CI$ does although both confidence intervals have severe under-coverage values when $\rho_{e}=0.5$. These confidence intervals work more poorly for the case $\max_{g\leq G}n_{g}=100$. On the other hand, $CI_{\lambda}$ performs the best among the three methods. It has accurate coverage (94.5%-96%) for every data-generating process.

For Setup 2 (heteroskedastic errors), we consider two different points (Table $\text{\ref{tab:CI_LL2_0.8}}$ for $x=0.8$ and Table $\text{\ref{tab:CI_LL2_0.4}}$ for $x=0.4$). Table $\text{\ref{tab:CI_LL2_0.8}}$ shows that $CI_{\lambda}$ improves the accuracy greatly, and it attains coverage ratios close to 95%. $CI_{\mathrm{CR}}$ and $CI$ fail to reach even 90% coverage ratios for almost all cases. However, Table $\text{\ref{tab:CI_LL2_0.4}}$ shows that all three methods have 95% coverage ratios, and $CI_{\lambda}$ has over-coverage values at $x=0.4$. Differences between Table $\text{\ref{tab:CI_LL2_0.8}}$ and Table $\text{\ref{tab:CI_LL2_0.4}}$ come from the functional form of the error term $\sigma\left(X_{gj}\right)e_{gj}$. Since $\sigma\left(x\right)=\left(2+\cos\left(2\pi x\right)\right)/5$ takes a large value at $x=0.8$ and a small value at $x=0.4$, the conditional variance and covariance of error terms also do so. Overall, $CI_{\lambda}$ is the most conservative choice among the three methods. Our proposed confidence interval $CI_{\lambda}$ performs well even without undersmoothing (see Appendix $\text{\ref{sec:Add_sim}}$).

We recommend $CI_{\lambda}$ because it works the best for homoskedastic errors, and it provides a conservative interval for heteroskedastic errors in our simulation.

Empirical Illustration

In this section, we will apply our methods to a dataset from alatas2012targeting,\footnote{Their replication package, including datasets, is available on the AEA website.} which ran an experiment in 640 Indonesian subvillages with heterogeneous cluster sizes from 17 to 72. The purpose is to investigate a good way to target people with low incomes. In their subvillage-level randomized assignments, they compare three different ways of targeting: using demographic characteristics as proxies of income, using the community knowledge on the ranking of wealth (community targeting), and using a hybrid of them. The wealth ranking for community targeting was measured as follows. In each subvillage, people were asked to rank everyone in the community from the richest to the poorest. A facilitator used randomly ordered index cards, each representing a household. Starting the first two cards, the facilitator asked the community which household was better off in terms of wealth. Based on the community\textquoteright s response, the cards were placed with the wealth order. By sequentially adding one more index card to the comparison, the facilitator continued the process until all the households had been ranked.

One concern for this ranking process is that human errors could happen since it took 1.68 hours on average. alatas2012targeting investigated this concern by running a nonparametric regression of the mistarget rate ($Y_{gj}$) on the card order in the ranking process ($X_{gj}$). The mistarget rate is calculated based on the household\textquoteright s per capita consumption. The card orders in the ranking process are scaled from $0$ to $1$. In nonparametric regression, error terms may exhibit dependence within the same cluster due to unobserved subvillage-level shocks during the ranking process (e.g., instances where some individuals leave the room, distracting others) or strategic interactions (e.g., groups colluding to appear poorer than they actually are to secure future aid). These dependencies are captured by the subvillage-level cluster random effects.\footnote{alatas2012targeting state that “Since the targeting methods were assigned at the subvillage level, the standard errors are clustered to allow for arbitrary correlation within a subvillage.” in a parametric regression analysis.} We revisit alatas2012targeting with theoretically justified methods for cluster sampling. We will use the local linear regression with the Epachenikov kernel while alatas2012targeting used the local linear regression with the quartic kernel (what they call nonparametric Fan regression). Since the regressor is an observed variable rather than a treatment assignment, the model-based approach is taken.\footnote{Although cluster sizes were randomly selected in their study, our theoretical results remain applicable when conditioning on the realized cluster sizes.}

By the random card order, it is reasonable to assume that the regressor $X_{gj}$ is independent within the cluster (subvillage). Since the distribution of $X_{gj}$ does not follow from $U[0,1]$ due to the lack of observations on the mistarget rate $Y_{gj}$, we also estimate it nonparametrically. Thanks to the independence of the regressor, we can estimate the joint density by the product of marginal densities. Other detailed calculations for the bandwidth selection and standard errors are done in the same way as in Section $\text{\ref{sec:Monte-Carlo-simulation}}$.

The sub-dataset for the above regression contains $n=3784$ observations, $G=431$ subvillages, and each subvillage has from 4 to 9 observations. Thus, $\max_{g\leq G}n_{g}$ is $9$. The bandwidth selected by CR-CV was $h_{\text{CR-CV}}=0.1301$, and the undersmoothing version, obtained by multiplying by the factor $n^{1/5}\times n^{-2/7}$ was $h_{\text{undersmoothing}}=0.0642$. In contrast, alatas2012targeting heuristically choose a bandwidth of $(\max(X_{gj})-\min(X_{gj}))/5=0.1979$. We plot the cluster-robust cross-validation function in Figure $\text{\ref{fig:cv_Alatas}}$.

figure[figure omitted — 164 chars of source]

We calculated three 95% confidence intervals: $CI$, $CI_{\mathrm{CR}}$, and $CI_{\lambda}$. We calculate $\widehat{\lambda}\approx1.148$. Since $CI$ and $CI_{\mathrm{CR}}$ are almost identical, we only draw $CI_{\mathrm{CR}}$ on the plot. Figures $\text{\ref{fig:Alatas}}$ and $\text{\ref{fig:Alatas-undersmooth}}$ show the estimated nonparametric regression values and estimated pointwise confidence intervals with $h_{m}=h_{\text{CR-CV}}$ and $h_{m}=h_{\text{undersmoothing}}$, respectively. The asymptotic bias exists under $h_{m}=h_{\text{CR-CV}}$, whereas it is asymptotically dominated under $h_{m}=h_{\text{undersmoothing}}$. The estimated nonparametric function appears more oscillatory and has wider CIs in Figure $\text{\ref{fig:Alatas-undersmooth}}$ due to the larger variance. We found that $CI_{\lambda}$ is slightly wider than $CI_{\mathrm{CR}}$ in both figures, however the difference is smaller in Figure $\text{\ref{fig:Alatas-undersmooth}}$, as the smaller bandwidth reduces within-cluster correlation in smaller neighborhoods. We recommend trying both bandwidth choices as a robustness check in practice. We still have significant pointwise differences between the first few households and the household in the middle of the ranking process (mistargeting rate rises 5-10%) even under wider confidence intervals $CI_{\lambda}$. The conclusions are similar to alatas2012targeting.

figure[figure omitted — 212 chars of source]
figure[figure omitted — 244 chars of source]

Conclusion

This article has developed a comprehensive theoretical framework for nonparametric regression analysis under cluster sampling. Our contributions are threefold, addressing critical aspects of cluster-dependent data analysis that have significant implications for econometric methodologies and applied research. First, we allow both growing and bounded size clusters. This extension is crucial, as growing cluster sizes introduce a non-negligible within-cluster dependence, necessitating the inclusion of an additional term in the asymptotic variance to capture this phenomenon accurately. Second, we cover the case where regressors contain common variables within the same clusters. These cluster-level regressors are the extreme case of cluster-dependent regressors, and they require the careful estimation of the joint density function. Third, our proposed inference is valid with heterogeneous and growing cluster sizes. The simulation studies illustrate the critical role of accounting for within-cluster dependence, affirming the practical relevance of our theoretical insights.

While this article establishes a foundation for nonparametric regression analysis under cluster sampling, several avenues for future research emerge. Theoretical work on other nonparametric estimators, such as local polynomial regressions and series regressions, would be an interesting extension. Investigating boundary analysis is crucial due to its impact on estimator bias. Additionally, developing cluster bootstrap inference methods for nonparametric regressions is important since it would provide more practical statistical inference for clustered data. Lastly, deriving honest and adaptive uniform confidence bands, as done by chernozhukov2014anti and chen2024adaptive in the i.i.d. case, represents an important extension. This direction would depend on future advancements in empirical process theory under cluster sampling.