# What test is this for endogenous variables?

Can somebody tell me whether the following R code (for econometrics endogenous variables) is for a Hausman test, a Nakamura test, or some other test?

etudes1 <- lm(EDUC  ~ EXPER+EXPERSQ+SMSA+SOUTH+FATHEDUC+MOTHEDUC)

test    <- lm(LWAGE ~ EDUC+EXPER+EXPERSQ+SMSA+SOUTH +residuals(etudes1))
summary(test)

• This is a two-stage least squares (2SLS) model. After you find the endogenous variables in your formula, you should use this model instead of an OLS model.
– Deng
Jul 16, 2019 at 19:23

What you have written looks like it could be the Hausman test, if $lwage$ was your main outcome of interest, $educ$ is your potentially endogenous predictor, and $feduc$ and $meduc$ are exogenous instruments (I'm not an R user, but that's what I gathered from your code, at least).

To recap, the Hausman test for endogeneity is carried out in two steps. Given the model you are trying to estimate:

$y_i =\beta_0 + \beta_1x_i + Z\beta + u_i$

Where:

• $y_i$ = main outcome of interest
• and $x_i$ = endogenous predictor of interest
• and $Z$ = a vector of exogenous predictors

First, regress $x_i$ on $Z$ and our instrument(s) (let's call it $I$) and save $\hat\nu_i$:

$x_i =\pi_0 + \pi_1I_i + Z\pi + \nu_i$

Because $Z$ and $I$ are exogenous (uncorrelated with $u_i$), it stands to reason that $x_i$ is uncorrelated with $u_i$ IFF $\nu_i$ is uncorrelated with $u_i$ (our main predictor of interest $x_i$ is exogoneous if and only if the two error terms are uncorrelated). Therefore, we need to formally test whether these two error terms are correlated.

Second, run the Hausman test by regressing $y_i$ on $x_i$, $Z$, and $\hat\nu_i$:

$y_i =\beta_0 + \beta_1x_i + Z\beta + \delta\hat\nu_i + error$

For this test $H_0: \delta=0$. If the coefficient on $\hat\nu_i$--that is, $\delta$--is significant, we can conclude that $x_i$ was in fact endogenous because the two error terms were, in fact, correlated.

I imagine most statistical packages today have the Hausman test for endogeneity built-in. What I have provided above is what used to be done manually "back in the day."

Source: Wooldridge, J. 2003. Introductory Econometrics: A Modern Approach. 2nd ed. New York: Thomson Learning

Your code does not provide the Hausman test for endogneity. The hausman.systemfit() from the systemﬁt package in R should do the trick.

Hope that helps.

FJA

• Do you know what kind of test it is? (I think that might help the OP.) Jun 6, 2013 at 15:14
• +1, I think it would help the OP if you would put some of that into your answer & unpack it a little bit. Eg: how what is posted differs from the logic of (say) the Hausman test, etc., whether this test is likely to be useful / accurate, etc. Jun 6, 2013 at 15:29
• Thanks for your answer. In a next question I will post in a few minutes I will complete. Jun 6, 2013 at 16:17