# Check for endogeneity

I run a log linear model, as $log(y) = b_0 + b_1x_1 + b_2x_2 + e$. I think $x_1$ may be endogenous and I would like to test it, so that I can consequently run a two-stage model. I would like to know if I there is a way to check it or if I must have at least one instrumental variable for $x_1$.

Another specification of my model is $log(y) = b_0 + b_1log(x_1) + b_2x_2 + e$. May I use the same procedure with a logarithm or is there a difference?

• Your use of Stata seems incidental here as the question is statistical in essence. I've edited out mentions of Stata. Asking for Stata code would, BTW, usually be off-topic here. Commented Dec 1, 2016 at 12:42

In general, endogeneity is a theoretical property and not something that can be tested from the data at hand. Then you need something as an instrument, like you say.

The second question sounds more like you are wondering what functional form will be best. There will certainly be a difference in the parameter values, but it may be that the predictions from the two are the same. You can run both, predict and inspect visually:

You could for example estimate model 1 first and compute $\widehat{\log y_1}$ as the predicted values from the first model and $\widehat{\log y_2}$ as the predicted values from the second. Then you can plot them against each other.

Stata code could be

reg logy x1 x2
predict yhat1 , xb
g logx1 = log(x1)
reg logy logx1 x2
predict yhat2 , xb
twoway (scatter logy x1) (scatter yhat1 x1) (scatter yhat2 x1) , legend(order(1 "data" 2 "linear" 3 "logarithmic"))

• Good to focus on giving statistical advice here. Please see my comment on the question itself. Commented Dec 1, 2016 at 12:44
• Superpronker, while I agree with you that theory is important to identify the potentially endogenous variables, as @DJohnson pointed out below, one can test whether there is evidence of endogeneity in the data. If there was no endogeneity, we would simply present results from the OLS, regular probit, etc. models instead of the instrumental variable models Commented Dec 21, 2016 at 18:18
• @MarquisdeCarabas, OP asks " I would like to know if I there is a way to check it or if I must have at least one instrumental variable for $x_1$?". The answer is that one does need at least one instrument to conduct any kind of test. And any tests of endogeneity relies on maintained exogeneity of an instrument. Commented Dec 22, 2016 at 14:03
• Oh yes, indeed the (exogenous) instrument or exclusion restriction is needed for the test of endogeneity. And of course, whether something is expected to be endogenous or exogenous does come, as you point out, from the theoretical model. Commented Dec 22, 2016 at 14:11

This response takes issue with @superpronker's suggestion that endogeneity is not testable. To be specific, Wooldridge offers an explicit test for it in the first edition of his book, Econometric Analysis of Cross-Section and Panel Data, chap. 6.2.1, beginning on p. 118, where he writes:

We start with the linear model and a single possibly endogenous variable. For notational clarity we now denote the dependent variable by y1 and the potentially endogenous explanatory variable by y2...The population model is

y1=z1 d1 + a1 y2 + u1

The maintained exogeneity assumption is

E(z' u1)=0

(Following a suggestion by Hausman) a formal test of endogeneity is: if y2 is uncorrelated with u1, the OLS and 2SLS estimators should differ only by sampling error.

Basically, Wooldridge is saying that if the residuals are significantly correlated with the explanatory variable(s) then there is evidence for endogeneity and "2SLS is probably a good idea," (p. 120)...

• that is not a test of endogeneity, though. Instead, it is a joint test of relevance of the instrument and the maintained assumption that the instrument does not belong in the primary regression. These things cannot be distinguished. In that sense, I think it is wrong of wooldridge to phrase it like that. In general, endogeneity and exogenously of a variable or instrument is a theoretical matter that we must have a priori beliefs/knowledge/assumptions about. Commented Dec 11, 2016 at 12:51
• Indeed, Wooldridge phrasing is misleading. Hausman test for endogeneity essentially tests whether OLS and 2SLS have the same probability limit. Assume they do. Then, endogeneity or not, there is no point in applying 2SLS with its higher variance. Assume they don't have the same probability limit. Then if we accept that some variable is endogenous then it is not pointless to use IV estimation. The test does not test for endogeneity (cc @Superpronker) Commented Dec 21, 2016 at 18:59
• @Superpronker So, your position is that there is no empirical support or evidence for endogeneity? That seems extreme and, given Wooldridge's assertions, wrong. Beyond your own opinion, what can you offer in the way of published support for such a strong, counterfactual statement? Commented Dec 22, 2016 at 17:38
• DJohnson, of course if you are willing to make other assumptions that are linked you can test those. However, OP asks whether he can test for endogeneity or if he will need an instrument. And as @AlecosPapadopoulos points out, the Hausman test explores if the two estimators have the same probability limit. If they do, it is a sign that things are going well (either there was no endogeneity in the first place or the instrument or something else is amiss). If they do not, either there is endogeneity and 2SLS is right or there is not and the first stage is misspecified. Commented Dec 22, 2016 at 21:33
• @Superpronker With all due respect, your response remains self-referential. Would it be possible to provide a more solid reference to something in the econometric literature to bolster your (and Alecos') claims? Commented Dec 22, 2016 at 22:22