On Mon, 12 Sep 2016, Ding, Jie Ding (NIH/NIA/ERP) [F] wrote:
Dear Achim,
Sorry to have disturbed you. I have encountered a problem when computing
Hausman test statistics (i.e. p values) in R to compare OLS and 2SLS models.
The problem is a discrepancy between the two p-value outputs from the "manual approach (by hand)"
and the " diagnostics argument" in the "AER" library, respectively.
With respect to manual approach, I used the following codes:
cf_diff<-coef(ivreg)-coef(olsreg)
vc_diff<-vcov(ivreg)-vcov(olsreg)
x2_diff<-as.vector(t(cf_diff)%*% solve(vc_diff)%*%cf_diff)
pchisq(x2_diff,df=2,lower.tail=FALSE)
For diagnostic approach, I applied the following:
summary(ivreg, vcov = sandwich, df = Inf, diagnostics = TRUE)
However, p-value from the manual approach is always much larger than the
diagnostic approach, e.g. 0.329 vs. 0.138
I would expect the values should be the same. Your advice would be
highly appreciated.
The Wu-Hausman test in ivreg() follows the auugmented regression approach
that is also used by Stata. This regresses the endogenous variable on the
instruments and includes the fitted values in an OLS regression. The test
is then a simple Wald test, see:
http://www.stata.com/support/faqs/statistics/durbin-wu-hausman-test/
With very best wishes,
Jennifer
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.