0

Here is my code:

ivmod = IV2SLS(y,  None,  df['VariableOne'], df['RandomVariable'])
res_2sls = ivmod.fit()
res_2sls.wu_hausman()

Here is the test result:

Wu-Hausman test of exogeneity
H0: All endogenous variables are exogenous
Statistic: 6.7774
P-value: 0.0096
Distributed: F(1,398)
WaldTestStatistic, id: 0x7fe9ff715d50

Am i doing this right? What do I make of the results?

1 Answers1

0

When you reject with a Hausmann test you are effectively comparing the OLS estimate of your parameter on VariableOne to the 2SLS estimate of the same. If these two estimates differ, then you should believe that the variable is endogenous. If they are the same (in a statistical sense), then you should usually use OLS. Note that the Hausmann test is not weak instrument robust, and so if you are using random data as the instrument your test is invalid.

Kevin S
  • 2,595
  • 16
  • 22