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.
22,801 characters · 9 sections · 10 citation commands
csa2sls: A complete subset approach for many instruments using Stata
\inserttype[st0001]{article} { Seojeong Lee\\Department of Economics\\Seoul National University\\Seoul, Korea\\[email removed] \and Siha Lee\\Department of Economics\\McMaster University\\Hamilton, Ontario, Canada\\[email removed] \and \\ Julius Owusu\\Department of Economics\\McMaster University\\Hamilton, Ontario, Canada\\[email removed] \and \\ Youngki Shin\\Department of Economics\\McMaster University\\Hamilton, Ontario, Canada\\[email removed] }
The two-stage least squares (2SLS) estimator is one of the most widely used methods in applied economics. Theoretically, the optimal instrument can be achieved by the conditional mean function of the first-stage regression. However, in practice, practitioners working with a finite sample face a crucial question of how many instruments one should use, especially when there are many instruments available. This is partly due to the well-known trade-off between bias and variance when the number of instruments increases. donald2001choosing shows this point clearly by a higher-order Nagar expansion and proposes to choose the optimal number of instruments that minimizes the mean squared errors. kuersteiner2010constructing proposes a model averaging approach for the first stage regression and shows that it achieves the optimal weight. These other approaches, however, either require the practitioner to know the order of importance among instruments donald2001choosing as the method chooses the first few important instruments, or the practitioner needs to estimate the optimal weights for the instruments kuersteiner2010constructing.
As an alternative, lee2021complete proposes a model averaging approach that uses all size-$k$ subsets of the set of available instruments in a cross-sectional regression model. This new approach is named as the complete subset averaging two-stage least squares (CSA2SLS) estimator. One advantage of the CSA2SLS estimator is that since it uses all subsets, it does not require knowledge of the order of importance among instruments. Furthermore, averaging models using equal weights reduces potential efficiency loss in finite samples. This is because when estimated weights (instead of equal weights) are used, these become additional parameters in the model and therefore, cause inefficiency when the number of models to be averaged is large.
We develop a Stata command csa2sls that implements the CSA2SLS estimator. It selects the optimal number of subset size $k$ that minimizes the approximate mean squared errors. Since the size of the complete subset grows at the order of $2^K$, where $K$ is the total number of instruments, CSA2SLS is computationally intensive. To alleviate such a computational burden, the command csa2sls includes options for subsampling and a fast-but-memory-intensive method.
The remainder of the paper is organized as follows. In Section 2, we introduce the complete subset averaging two-stage least squares (CSA2SLS) estimator in lee2021complete. Section 3 explains the command csa2sls. Section 4 shows results from Monte Carlo experiments which numerically illustrates how the CSA2SLS estimator alleviates some of the issues that arise from many instruments. We provide an empirical application of csa2sls in Section 5. Section 6 concludes.
In this section, we explain the key idea of the CSA2SLS estimator in lee2021complete. Heuristically speaking, we estimate the first-stage predicted value by model averaging and apply the 2SLS estimation with those predicted values. Given a total of $K$ instruments, we consider all subsets composed of $k$ instruments. We compute a simple average of predicted values across models and the 2SLS estimator follows immediately. The optimal $k$ is selected by minimizing the approximate mean squared errors criterion, which will be explained in detail below.
To be concrete, consider the following model generated from an independent and identically distributed (i.i.d.) sample:
where $y_i$ is a scalar outcome variable, $\mathbf{Y}_i$ is a $d_1\times1$ vector of endogenous variables, $\mathbf{x}_{1i}$ is a $d_2\times1$ vector of included exogenous variables, and $\mathbf{z}_i$ is a vector of exogenous variables (including $\mathbf{x}_{1i}$), $\mathbf{f}(\cdot)$ is an unknown function of $\mathbf{z}$, and $\epsilon_i$ and $\mathbf{u}_i$ are error terms uncorrelated with $\mathbf{z}_i$. Finally, $\boldsymbol\eta_{i}$ denotes an error term when we project the endogenous regressor $\mathbf{Y}_i$ into the space of exogenous variable $\mathbf{z}_i$. Note that $E[\boldsymbol\eta_{i}|\mathbf{z}_{i}] = 0$ by construction.
Let $y = (y_{1},.., y_{N})'$, $\epsilon = (\epsilon_1,...,\epsilon_N)'$, $\mathbf{X} = (\mathbf{X}_{1},..., \mathbf{X}_{N})'$, $\mathbf{f} = (\mathbf{f}_{1},...,\mathbf{f}_{N})'$, and $\mathbf{U} = (\mathbf{u}_{1},...,\mathbf{u}_{N})'$ where $\mathbf{f}_i = \mathbf{f}(\mathbf{z}_{i})$. The set of instruments has the form $\mathbf{Z}_{K,i} \equiv ( \psi_{1}(\mathbf{z}_{i}),...,\psi_{K}(\mathbf{z}_{i}), \mathbf{x}_{1i})'$, where $\psi_{k}$'s are functions of $\mathbf{z}_{i}$ such that $\mathbf{Z}_{K,i}$ is the collection of $(K + d_2)$ instruments. Note that the total number of instruments $K$ can increase as $N \rightarrow \infty$. We suppress the dependency of $K$ on $N$ for notation simplicity. Let $\mathbf{Z}_K = (\mathbf{Z}_{K,1},..., \mathbf{Z}_{K,N})'$ be the collection of $\mathbf{Z}_{K,i}$.
Let $M$ be the number of subsets (or models) with $k$ instruments:
We also suppress the dependency of $M$ on $K$ and $k$. Let $m\in\{1,\ldots,M\}$ be an index of each model and $\mathbf{z}_{m,i}^{k}$ be a vector of instruments in model $m$. Then, the first-stage regression of model $m$ can be written as
The average predicted value of $X$ is
where $\hat{\Pi}_m^{k}$ is the OLS estimator of ${\Pi}_m^{k}$. Then, the CSA2SLS estimator is defined as
Using the projection matrices, we can also write the CSA2SLS estimator as a one-step procedure:
where $\mathbf{P}^k = {M}^{-1}\sum_{m=1}^{M} \mathbf{P}_{m}^{k}$ with $\mathbf{P}_{m}^{k} = \mathbf{Z}_{m}^k\left(\mathbf{Z}_{m}^{k'}\mathbf{Z}_{m}^k\right)^{-1}\mathbf{Z}_{m}^{k'}$.
The optimal subset size $k$ is chosen by minimizing the approximate mean squared error. Let $\tilde{\boldsymbol\beta}$ be a preliminary estimator and $\tilde{\boldsymbol\epsilon} = \mathbf{y}-\mathbf{X}\tilde{\boldsymbol\beta}$. The fitted value of $\mathbf{f}$ is given as
where $\tilde{\mathbf{Z}}^k$ consists of exogenous variables plus the preliminary selection of instruments as described above. Let $\tilde{\mathbf{P}}_Z = \tilde{\mathbf{Z}}^k\big(\tilde{\mathbf{Z}}^{k'}\tilde{\mathbf{Z}}^{k}\big)^{-1}\tilde{\mathbf{Z}}^{k'}$. The residual matrix is denoted by $\tilde{\mathbf{u}} = \mathbf{X}-\tilde{\mathbf{f}}$. Define $\tilde{\mathbf{H}} = \tilde{\mathbf{f}}'\tilde{\mathbf{f}}/N$, $\tilde{\sigma}_{\epsilon}^2 = \tilde{\epsilon}'\tilde{\epsilon}/N$, $\tilde{\sigma}_{u\epsilon} = \tilde{u}'\tilde{\epsilon}/N$, $\tilde{\sigma}_{\lambda\epsilon} = \tilde{\boldsymbol\lambda}'\tilde{\mathbf{H}}^{-1}\tilde{\sigma}_{u\epsilon} $ and $\tilde{\Sigma}_{u} = \tilde{\mathbf{u}}'\tilde{\mathbf{u}}/N$. Then, the sample counterpart of the approximate mean squared error is given by
where
The preliminary estimator $\tilde{\boldsymbol\beta}$ can be estimated either by using the two-step Malllows's criterion or by adopting the one-step method. See lee2021complete for detail.
The generic syntax for the command is as follows:
The four arguments of the command are depvar (the dependent variable), exogvar (the list of included exogenous variables), endovar (the endogeneous variable) and instvar (the list of excluded exogenous variables, i.e.\ instrumental variables).
ereturn list command has the following stored information:
In this section, we conduct Monte Carlo simulation studies focusing on the effect of correlated instruments. An $i.i.d.$ sample $(y_i,Y_i, \mathbf{z}_i)$ is generated from the following simulation design:
where $Y_i$ is a scalar endogenous regressor, $(\beta_0, \beta_1)$ is set to be $(0, 0.1)$, and $\mathbf{z}_i$ is a $K$-dimensional vector of instruments generated from a multivariate normal distribution $N(0,\boldsymbol\Sigma_z)$. The diagonal elements of $\boldsymbol\Sigma_z$ are set to be 1 and the off-diagonal elements are $\rho_z$. We set each element of $\boldsymbol\pi$ to be $\sqrt{0.1/(K + K(K-1)\rho_z (1-0.1))}$, where 0.1 is the R-squared in the first stage regression. The vector of error terms $(\epsilon_i, {u}_i)$ follows a bivariate normal distribution whose means are zeros and variances are ones. The covariance between $\epsilon_i$ and $\mathbf{u}_i$ is set to be 0.9. In these simulation studies, $K$ varies in $\{5, 10, 15, 20\}$ and $\rho_z$ varies in $\{0, 0.5, 0.9\}$. The sample size is set to be $n=100$ and the results are from 1,000 replications.
Figure (ref) summarizes the simulation results. We report the mean bias and mean squared error (MSE) of CSA2SLS along with the performance of the ordinary least squares estimator (OLS) and the two-stage least squares estimator (2SLS). First, the CSA2SLS estimator reduces the bias substantially when instruments are correlated ($\rho_z=0.5, 0.9$). As predicted by theory, the bias of 2SLS increases as $K$ increases. Note that when instruments are independent ($\rho_z=0.0$), the difference in the bias between the CSA2SLS estimator and the 2SLS estimator is small. lee2021complete proves that the performance of CSA2SLS will be asymptotically equivalent to that of 2SLS when $\rho_z=0$.
Second, the efficiency loss of CSA2SLS is modest. When instruments are correlated, CSA2SLS achieves lower mean squared errors when $K \ge 10$. Like the bias, the MSE gap between CSA2SLS and 2SLS increases as $K$ increases. It is also worthwhile to note that the MSE of CSA2SLS does not change much over different values of $K$. Finally, the OLS estimator performs the worst in these simulation designs.
To sum, the CSA2SLS estimator shows a good finite sample performance as predicted by theory. We also observe the increased bias of 2SLS when there are many instruments. We recommend practitioners to use the CSA2SLS estimator when they have many correlated instruments.
In this section we illustrate the usage of csa2sls by an empirical application. In this example, we revisit \citet*{berry1995automobile} and estimate a logistic demand function for automobiles based on pooled cross-sectional data over different markets.
The model is specified as
where $S_{i}$ is the market share of product $i$ with product 0 denoting the outside option, $P_{i}$ is the endogenous price variable, $\mathbf{X}_{i}$ is a vector of included exogenous variables and $\mathbf{Z}_{i}$ is a set of 10 instruments. The parameter of interest is $\alpha_0$ from which we can calculate the price elasticity of demand. Note that the optimal subset size $k$ is 9 in this empirical example.
We also report correlation coefficients among the instruments. We can confirm that the instruments are divided into two groups and that each group's instruments are highly correlated with each other. The correlation coefficient varies from 0.69 to 0.99.
In this article, we present the complete subset averaging two-stage least squares estimator and develop the corresponding Stata command csa2sls. The usage of csa2sls is illustrated by an empirical application. The Monte Carlo experiments show that 2SLS is biased when there are many instruments and that CSA2SLS outperforms 2SLS when instruments are correlated with each other. Since CSA2SLS is computationally intensive, an interesting future research question would be to develop a more efficient computation algorithm. An approach based on the stochastic gradient descent (see, for example, lee2022fast) can be a possible solution.
We would like to thank the editor and an anonymous reviewer for their valuable comments on this article and for their helpful feedback on the program code. Shin is grateful for partial support by the Social Sciences and Humanities Research Council of Canada (SSHRC-435-2021-0244).
\endinput