I have used OLS to estimate an equation from the cross
section dataset of a year. I would be grateful, if
someone would tell me the commands to use to detect if
there is endogeneity between an independent variable
and the dependent variable.
2. What are the Stata commands to remedy the
endogeneity problem please.
1) use ivreg2 (findit ivreg2) and the orthog option to challenge one
or more regressors in an OLS specification for endogeneity. For
instance, with auto,
tests the hypothesis that mpg is properly treated as exogenous in an
OLS regression of price on mpg, headroom and trunk. You must have,
under the alternative hypothesis, some way to identify the equation
using the instrumental variables estimator, so there are two excluded
instruments (weight and displacement) that are used to identify the
coefficient on mpg under the alternative.
The verdict from the "C" test is that the null is not rejected at the
90% level, and OLS in this context is OK. If you do not use robust
standard errors, the verdict will be reversed; the "Sargan" statistic
is not H-robust, whereas Hansen's J is.
re 2), read the paper by Baum-Schaffer-Stillman in SJ 3:1 regarding
tests of exogeneity/enodgeneity (paper is also available from my URL
below as a preprint) and read the appropriate sections of the ivreg2