How can I get the weak instrument F-test statistic in modelsummary
?
data(mtcars)
library(ivreg)
iv_model <- ivreg(mpg ~ qsec + cyl + drat | disp | wt, data = mtcars)
summary(iv_model, diagnostics = TRUE)
Call:
ivreg(formula = mpg ~ qsec + cyl + drat | disp | wt, data = mtcars)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23.28560 20.84029 1.117 0.27370
disp -0.05730 0.02053 -2.791 0.00953 **
qsec 0.20443 0.59223 0.345 0.73263
cyl 0.88477 1.52033 0.582 0.56542
drat 0.25095 2.19015 0.115 0.90962
Diagnostic tests:
df1 df2 statistic p-value
Weak instruments 1 27 19.96 0.000127 ***
Wu-Hausman 1 26 13.87 0.000956 ***
Sargan 0 NA NA NA
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
The metrics = "all"
option does show the Wu-Hausman and Sargan test by default.
library(modelsummary)
modelsummary(iv_model, metrics = "all")