# Mixing instruments in ivreg2 estimation in Stata

When using a 2sls estimation with ivreg2 with more than one endogenous variable, Stata necessarily -- as it seems to be -- instruments both endogenous variables with the same set of instruments; that is, if for one of the endogenous variables, $y_1$, I have the set of instruments $z_1$ and $z_2$, and for the second endogenous variable, $y_2$, I have the set $z_3$ and $z_4$, Stata will run first stage regressions for the first endogenous variable ($y_1$) with all the instruments ($z_1$, $z_2$, $z_3$ and $z_4$) and the same happens for the second endogenous variable ($y_2$). Is there a built-in-code to deal with this kind of problem?

If that does not exist in Stata, I know I could use the solution created by Kit Baum and provided by user Andy here. I've adapted the code for two endogenous variables and calculated the correct Standard Errors by just adding vecdiag(cholesky(diag(vecdiag(vcorr)))) and adapting it into a variable. But I wasn't able (for now) to create the additional statistics that ivreg2 produces additionaly, that is, the Kleibergen-Paap rk LM statistic, the Cragg-Donald Wald F statistic or the Kleibergen-Paap rk Wald F statistic (along with the Stock-Yogo critical values) and the Hansen J Statistic. I would be glad if someone could point me some additional coding (or functions) that could at least partially deal with this lack statistical test in my output results.

What Stata does is perfectly fine and it is not a problem. Consistent estimation of IV/2SLS regressions requires that all the instruments appear in all first stages. In the two first stages you should see for $y_1$ that $z_1$ and $z_2$ have the largest effect whilst for $y_2$ it should be $z_3$ and $z_4$. The test statistics produced by ivreg2 are valid for your estimation problem and some of the are especially designed for this type of regression like the Angrist and Pischke F-statistic, or the Stock-Yogo critical values for the Cragg-Donald statistic. This is also described in the ivreg2 help file.

If you still have your heart set on estimating the first stages separately you need to use a multiple-equation model and use 3SLS instead (see this post in the Statalist regarding this topic).

• It might be a problem from a theoretical point of view -- I mean, from a theory your using as reference for your estimation. As when you have a model in mind that says exactly what should be the type instruments for each endogenous variable. An example might be estimating the own-elasticity and the cross-elasticity of a residual demand of a company: to obtain the own-elasticity, you would need to instrument the price with variables such as the cost of the company and, to obtain the cross-elasticity, you would need to instrument the price of the other company with its other costs. Mar 13, 2015 at 10:27
• Mixing the instruments wouldn't make sense. Mar 13, 2015 at 10:27
• If that is true then 2sls isn't for this problem and you better specify a multi equation model and estimate it with 3sls or fiml, so in this sense I do not quite follow your remark here.
– Andy
Mar 13, 2015 at 10:40
• I understand, I think. Would it be considered 3sls if I were to run something like two first stage regressions? A first stage regression with one endogenous variable and its instruments (backed by theory) and a second regression in the first stage with the second endogenous variable with its instruments. Mar 13, 2015 at 11:43
• That's a set of multiple equations that are to be estimated together, yes. Have a look at the Stata documentation of reg3 under the heading methods and formulas: stata.com/manuals13/rreg3.pdf
– Andy
Mar 13, 2015 at 12:00