# Is it true that if one coefficient in a linear model is endogenous, then any individual coefficient will be inconsistent?

This question is related to Bias of more than one endogenous variables, and I am essentially asking for some help regarding proving the results of the answer algebraically along with some related questions.

Suppose I have the linear model $Y = X\beta + W\gamma$ + U, where $Y,X,W$ are all matrices, and $W$ is a set of controls. I have my instrument for $X$, the variable of interest. I do not know if $W$ is endogenous or not, but because it is just a bunch of controls, I naively figure I don't need to worry about them because I'm ONLY concerned with estimating $\beta$. I basically want the algebraic proof for why it does matter (which seems to be the case).

The Set Up:

Because $X$ may be endogenous, I perform the following 2SLS, with instrument $Z$ for $X$. The model would be as follows: $$\text{first stage: } X = Z\alpha + T\theta + V \\ \text{second stage: } Y =\hat{X}\beta + W\delta + D$$ where $T$ is a set of first stage controls, and $W$ is the set of second stage controls, and $\hat{X}$ is the fitted values of $X$. My questions are as follows (assuming I correctly set up the problem):

1. I am correct that the error term $O$ is generally not the same as U in the true model, right?
2. Does it matter if W, the set of controls for the second stage, are endogenous, if all I care about is the coefficient $\beta$? Based on the linked question, it does, but what is the algebraic proof? I have not been able to do much.
3. Similar to 2. , but does it matter if T is endogenous, again if all I care about is estimating $\beta$?

$\textbf{Update}$: I did some work on this which I was able to check based on @semibruin's fantastic answer, and have the following results:

Considering the endogeneity problems, we have: \begin{align*} \hat{\beta}^{2sls}=&(\hat{X}'M_w\hat{X})^{-1}\hat{X}'M_wY\text{ (where }M_w=I-W(W'W)^{-1}W'\text{)} \\ =&(\hat{X}'M_w\hat{X})^{-1}\hat{X}'M_w(\hat{X}\beta+W\delta+D) \\ =&\beta+0+(\hat{X}'M_w\hat{X})^{-1}\hat{X}M_wD \\ \xrightarrow{plim}&\beta+E[\hat{X}'M_w\hat{X}]^{-1}E[\hat{X}'M_wD] \end{align*} So the estimator $\hat{\beta}^{2sls}$ is consistent when $E[\hat{X}'M_wD]=0$. Focusing on that expression, we look at one issue at a time:\ First, let's ignore the first controls (ie set $T=0$). Then $\hat{X}=Z\hat{\alpha}$ Recalling results from linear algebra and partitioned regressions, $P_w:=W(W'W)^{-1}W'\text{ and } M_w:=I-P_w$ are both projection matrices (in particular, it can be easily verified that $P_wW=W$ and $M_wW=0$), and we have $Z\hat{\alpha}=Z(Z'Z)^{-1}Z'X$. Furthermore, for any $X$, $X'X$ is a symmetric matrix (so that $(X'X)^{-1}{'}=(X'X)^{-1}$ ). Then, since $X'=\alpha'Z'+V'$, we have: \begin{align*} E[\hat{X}'M_wD] &=E[(Z\hat{\alpha})'M_wD] \\ &=E[(Z(Z'Z)^{-1}Z'X)'(I-W(W'W)^{-1}W')D]\\ &=E[X'Z(Z'Z)^{-1}Z'(I-W(W'W)^{-1}W')D]\\ &=E[X'P_zD]-E[X'P_zP_wD]\\ &=\alpha'E[Z'D]+E[V'P_ZD]-\alpha'E[Z'P_wD]-E[V'P_zP_wD]\\ &=E[V'P_ZD]-\alpha'E[Z'P_wD]-E[V'P_zP_wD]\\ &\text{and I'm not sure where to go next} \end{align*} Thus, we are not guaranteed consistency, and have consistency of $\hat{\beta}$ only if...

Next, let's ignore the second controls (ie set $W=0$), but consider the first controls. Thus, $\hat{X}=Z\hat{\alpha}+T\hat{\theta}$, $\hat{\beta}=(\hat{X}'\hat{X})^{-1}\hat{X}'Y$ where $Y=\hat{X}\beta+D$, and $\hat{\beta}^{2sls}\xrightarrow{plim}\beta+E[\hat{X}'\hat{X}]^{-1}E[\hat{X}'D]$. Then, recalling that $X=Z\alpha+T\theta+V$: \begin{align*} E[\hat{X}'D]&=E[(Z((Z'M_TZ)^{-1}Z'M_TX)+T((T'M_ZT)^{-1}T'M_ZX))'D]\\ &=E[(Z(Z'M_TZ)^{-1}Z'M_T(Z\alpha+T\theta+V))'D]+E[(T(T'M_ZT)^{-1}T'M_Z(Z\alpha+T\theta+V))'D]\\ &=E[Z\alpha)'D]+0+E[(Z(Z'M_TZ)^{-1}Z'M_TV)'D]+0+E[(T\theta)'D]+E[(T(T'M_ZT)^{-1}T'M_ZV)'D]\\ &=E[(Z(Z'M_TZ)^{-1}Z'M_TV)'D]+\theta E[T'D]+E[(T(T'M_ZT)^{-1}T'M_ZV)'D] \text{ (recall $E[T'D]\neq0$)}\\ &\text{again, I'm not sure where to go next} \end{align*} Again, we are not guaranteed consistency, and have consistency of $\hat{\beta}$ only if...

In the first case, it would seem that if $Cov[Z,W] =0$, then we would have consistency. In the second case, even if $Cov[Z,T]=0$, because $E[T'D]\neq0$, we will still not have consistency, and likewise for $Cov[Z,T]=0$ in the second case.