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. 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.