I run instrumental variable regression (2SLS) with ivreg
package.
library(ivreg)
as_tibble(mtcars)
model_iv <- ivreg(formula = mpg ~ disp + drat |
drat + carb,
data = mtcars)
As many other people, I am interested in the diagnostics (e.g. weak instruments, wu-hausman and sargan) attached to my model reporting.
summary(model_iv, diagnostics = TRUE)
Diagnostic tests:
df1 df2 statistic p-value
Weak instruments 1 29 8.286 0.00743 **
Wu-Hausman 1 28 11.594 0.00202 **
Sargan 0 NA NA NA
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
There is a workaround to add those to stargazer
:
R: Robust SE's and model diagnostics in stargazer table
And I found the very discussion in an issue for modelsummary
:
https://github.com/vincentarelbundock/modelsummary/issues/123
I tried the modelsummary
but it seems that the feature hasn't been implemented. Is there another package for model reporting including diagnostics for instrumental variable models?