# Why do you put all the exogenous variables into the first and second stage of 2SLS?

For a general MLR, let's say we have k endogenous X's, r exogenous W's, and m instruments.

The first stage of the 2SLS model is regressing each of the endogenous X's on all the Z's and W's. For the second stage, we then take the predicted values of X and fit it to our original model which also include our W's.

So why do we regress on the exogenous variables W in both stages? Since they are exogenous, isn't regressing in one of them sufficient. Could someone give a rigorous explanation?

Technically, you are actually regressing $[X\;,\; W]$ on $[Z\;,\; W]$ so the resulting fitted values for the second stage regressors are $[\hat X\;,\; \hat W]=[\hat X \;,\;W]$.

$\hat W =W$ since the best prediction of $W$ available in the matrix $[Z\;,\; W]$ is obviously $W$ itself.

But the trivialities aside, $W$ is included in the first stage regressors because it is exogenous and so excluding $W$ would lead to a loss in efficiency or consistency (most likely both) of the 2SLS estimator. In other words, the purpose of the first stage is to sort of "devide out" the endogenous part of the $X$'s in that $\hat X$ is the part of $X$ which can be associated solely with exogenous movements (i.e. changes in $Z$ and $W$). If $X$ and $W$ are correlated at all, not including $W$ here would result in a large loss of information since the resulting fitted values would not reflect all the exogenous movement in $X$.

$W$ is included in the second stage to avoid omitted variable bias in the 2SLS coefficient estimates. At this point $\hat X$ is almost surely correlated with $W$ and so if $W$ has any effect on $Y$, leaving it out of the regression will result in bias coefficient estimates.

• I'd be happy to upvote this answer if you add one or two sentences about the consequences of not having the second stage controls in the first stage regression. – Andy Oct 20 '15 at 6:37
• @Andy , Yeah sorry about that. I just realized that my previous answer was trivial so I edited it – Zachary Blumenfeld Oct 20 '15 at 6:38

This question is quite old --- however I haven't found a fully satisfactory answer online for this query, so I am adding my 2 cents. PLEASE add a comment if you notice errors!

In the case of simultaneous equations (one particular framework for thinking about endogeneity and IV), the stata documentation has a nice page about omitting exogenous variables from the first stage: stata FAQ link

However, we aren't always in the simultaneous equations framework and I wanted more intuition. Note that in Wooldridge (panel data, aka papa Wooldridge), 2nd edition, page 97, he writes:

In practice, it is best to use a software package with a 2SLS command rather than explicitly carry out the two-step procedure. Carrying out the two-step procedure explicitly makes one susceptible to a harmful mistakes. For example, the following seemingly sensible, two-step procedure is generally inconsistent: (1) regress [endogenous] $$X_k$$ on [only the instruments], and obtain fitted values $$\hat{X_k}$$ (2) run the regression [$$y$$ on exog variables and $$\hat{X_k}$$]... [This] produces inconsistent estimators of the betas

In other words, omitting the exogenous variables in the first stage affects the consistency of the betas of interest. (standard errors will also have to be adjusted if 2SLS is run by hand in two stages).

To see why we need to include the exogenous variables in the first stage, first consider the following DAG:

Say we have the structural equation $$Y = a_1 T + a_2 X + \varepsilon_3$$

If we were to estimate this with OLS, our estimates would be biased because of the endogeneity of T and Y: $$E(T \varepsilon_3 ) \ne 0$$ Therefore we turn to 2SLS (IV), noting that Z satisfies the assumptions to be an instrument for T, as long as we control for X.

Generally, we can express $$T = \hat{T} + u$$ (For now, ignore exactly how we estimate the first stage and obtain the fitted values $$\hat{T}$$.)

Substituting into our previous equation: $$Y = a_1 \hat{T} + a_2 X + a_1 u + \varepsilon_3$$

To obtain consistent estimates of $$a_1$$ and $$a_2$$ with OLS, we need $$\hat{T}$$ and $$X$$ to be independent from both errors $$u$$ and $$\varepsilon_3$$.

From the original setup, $$X$$ is independent of $$\varepsilon_3$$.

Additionally $$\hat{T}$$ is independent of $$u$$ by construction---the linear projection is independent of the error term.

So the two things we are concerned about is whether $$\hat{T}$$ is independent of $$\varepsilon_3$$, and whether $$X$$ is independent of $$u$$.

Consider two different ways of estimating the first stage, i.e. obtaining $$\hat{T}$$ (apologies for slight abuse of notation in subscripts)

$$T = b_1 Z + u$$, $$\hspace{2cm} \hat{T_1} = \hat{b_1} Z$$

$$T = b_1 Z + b_2 X + u$$, $$\hspace{1cm} \hat{T_2} = \hat{b_1} Z + \hat{b_2} X$$

In the first case, if we use $$\hat{T_1}$$ in our second stage, $$u$$ will be correlated with $$X$$, resulting in inconsistency for estimating $$a_2$$. This will also cause issues for estimates of $$a_1$$, because $$corr(X,T) \ne 0$$

In the second case, if we use $$\hat{T_2}$$ in the second stage, now $$u$$ is independent of $$X$$ by construction!.

Additionally both $$\hat{T_1}$$ and $$\hat{T_2}$$ are independent of $$\varepsilon_3$$, because both $$Z$$ and $$X$$ are independent of $$\varepsilon_3$$.

Note that if $$\varepsilon_1 = 0$$, i.e. X is not related to T, then X could safely by omitted in the first stage.

Additionally, if $$\varepsilon_2 = 0$$, i.t. X is not related to Z, then if X is omitted from first stage $$a_1$$ is consistent but $$a_2$$ is not.

If you are still confused I'd encourage you to simulate data based on the DAG, run 2SLS for both cases and check correlations to confirm the conclusions in my answer.