I used iv_robust() with diagnostics = T, however glance() not report the first-stage statistics
library(estimatr)
library(fabricatr)
set.seed(42)
dat <- fabricate(
N = 40,
Y = rpois(N, lambda = 4),
Z = rbinom(N, 1, prob = 0.4),
D = Z * rbinom(N, 1, prob = 0.8),
X = rnorm(N),
G = sample(letters[1:4], N, replace = TRUE)
)
fit <- iv_robust(Y ~ D + X | Z + X, data = dat, diagnostics = T)
glance(fit)
r.squared adj.r.squared df.residual nobs se_type statistic p.value statistic.weakinst
value 0.1442495 0.0979927 37 40 HC2 3.15632 0.05424511 NA
p.value.weakinst statistic.endogeneity p.value.endogeneity statistic.overid p.value.overid
value NA NA NA NA NA
I used
iv_robust()
withdiagnostics = T
, howeverglance()
not report the first-stage statisticsI found that a simple miss spelling causes this problem: The
iv_robust
object containsdiagnostic_first_stage_fstatistic
butglance.iv_robust()
refersdiagnostic_firststage_fstatistic
, and other 2 elements are so on.