# What is the example of inaccurate impact due to endogeneity?

When learning about endogenous variable, I found an answer in a topic on StackExchange very direct:

An Exogenous Variable is defined as a variable which is unaffected by other variables within an model.

take a multivariable regression model as an example:

$$y=\beta_0+\beta_1x_1+\beta_2x_2+u$$

$$x_1$$ is called an exogenous variable when its determination is unaffected by $$x_2$$ and error term $$u$$.

An Endogenous Variable is defined when $$x_1$$ is influneced by $$x_2$$ or $$u$$.

This is important because when we run a regression we are producing a function which assumes a dependent and independent variable. If we find endogeneity we wont get accurate estimates for the effect of $$x_1$$ on $$y$$.

Why in endogeneity case, we wont get accurate estimates for the effect of $$x_1$$ on $$y$$ . Is there any sample for that statement? In reality, I faced this problem that when I add some regressors to a regression equation, one of variable coefficient changed the magnitude or even flip the sign. But I want to know the reason behind.
One theoretical explanation is: $$x_1$$ is correlated with $$u$$ or $$x_2$$, producing a bias in $$beta_1$$ that depends on the direction and magnitude of the correlation

Endogeneity can arise from several reasons and in each case the explanation will be slightly different. I won't show full review of all possible reasons but just two important examples:

Simultaneity

For example, following Verbeek a guide to modern econometrics pp 146, suppose that true model is given by system of equations:

$$y = \beta_1 + \beta_2 x_{2t} + \epsilon_t \tag{1}$$

$$x_{2t} = y_t + z_{2t} \tag{2}$$

where $$z$$ will be exogenous $$(cov(z,\epsilon) = 0)$$ but clearly $$x$$ is endogenous. We can see from the equations above that if $$x$$ increases not only does $$y$$ increase but $$x$$ increases again through effect of $$y$$ on $$x$$ given by $$2$$ which then again increases $$x$$.

Solving the 1 and 2 for $$x$$ and $$y$$ respectively we get:

$$x_{2t} = \frac{\beta_1}{1-\beta_2} + \frac{1}{1-\beta_2} z_{2t} + \frac{1}{1-\beta_2} \epsilon_t \tag{3}$$

$$y_t = \frac{\beta_1}{1-\beta_2} + \frac{\beta_2}{1-\beta_2} z_{2t} + \frac{1}{1-\beta_2} \epsilon_t \tag{4}$$

It follows from 3:

$$cov(x_{2t} \epsilon_t ) = \frac{1}{1-\beta_2} cov(z_{2t} \epsilon_t) + \frac{1}{1-\beta_2} V(\epsilon) = \frac{\sigma^2}{1-\beta_2} \tag{5}$$

The 5 just shows that $$x$$ will be correlated with $$\epsilon$$, but a direct consequence of this correlation is that:

$$\text{plim } b_2 = \beta_2 + \frac{cov(x_{2t}, \epsilon_t}{V(x_{2t})}$$

So what you are estimating is not just your beta coefficient you want $$\beta_2$$ but you are estimating sum of the true $$\beta$$ coefficient together with ratio of covariance between $$x$$ and $$z$$ to variance in $$x$$ or $$\frac{cov(x_{2t}, \epsilon_t}{V(x_{2t})}$$. This indeed can even force coefficients to flip. For example, suppose true effect $$\beta_2=5$$ but $$cov(x,z)=-20$$ and $$V(x)=1$$ then if you just naively run model $$y = b_1 + b_2 x_{2t} + \epsilon_t$$ your estimated $$\hat{b_2}$$ will be $$\hat{b_2} = 2 -20 = -18$$ which has opposite sign and the magnitude of $$b$$ will be distorted. So you will be getting unreliable results.

Ommited Variable Bias

This would be example, where we do not observe (or fail to include) variable that should be in the model. Again following Verbeek pp 145 consider individual wage equation:

$$y_ = x_{1i}' \beta_1 + x_{2i} \beta_2 + u_i \gamma + v_i$$

here $$y$$ would be wage, $$x_{1i}$$ is vector of individual characteristics (e.g. gender, age, location etc), $$x_{2i}$$ years of schooling and $$u_i$$ some unobserved innate ability. We expect that $$cov(x_{2i},u_i)>0$$ because it makes sense that if you have higher innate ability you will have higher education as people with high innate ability should have easier time at the school/university.

Now let us suppose that because innate ability is not observable you are forced to estimate:

$$y x_i'\beta + \epsilon_i$$

with $$x_i'=(x_{1i}', x_{2i})$$ and $$\beta'= (\beta_1', \beta_2),$$ and naturally since we omitted ability $$\epsilon_i = u_i\gamma + v_i$$.

Now the $$b$$ estimates of $$\beta$$ are given by:

$$b= \beta + \left( \sum_{i=1}^N x_i x_i' \right)^{-1} \sum_{i=1}^N x_i u_i \gamma + \left( \sum_{i=1}^N x_i x_i' \right)^{-1} \sum_{i=1}^N x_i v_i$$

Even assuming $$E(x_i, v) = 0$$ (i.e. there is no additional simultaneity or other endogeneity issues in the true model), we get:

$$\text{plim } b = \beta + \sum_{xx}^{-1}E[x_i u_i] \gamma$$

So as long either $$\gamma \neq 0$$ (in which case it should not be in the first model to begin with as that would mean ability does not affect wage), or $$E[x_i u_i] \neq 0$$ which in our case wont hold because we assumed ability does affect education, your estimated beta is not going to be actual effect of the independent variable on the dependent variable but the actual effect plus term determined by correlation between omitted and included independent variable and $$\gamma$$. Again this can change both magnitude and sign of $$\beta$$ so you simply can't trust it at all.

Lastly, there could be other ways in which endogeneity arises in econometric setting, but exploring all of them is beyond scope of SE, and the two above mentioned ones are probably the most common ones and relevant.