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)

 A: 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
A: 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
