I want to do an IV regression in Fixed-Effect Models with diagnostics (Wu-Hausman, weak instrument, etc.). I tried three options, each with its problem--
y is dependent variable
x1 is the endogenous independent variable
c1, c2, c3 are control variables
inst is the instrument variable
City and Year are two factors for fixed effects
- ivreg
fit_ivreg = ivreg(data, y ~ x1 + c1 + c2 + c3 + City + Year | inst + c1 + c2 + c3 + City + Year)
summary(fit_ivreg, diagnostics = T)
The problem of this model is that I am not sure if this is fixed-effect model at all.
- plm
fit_plm = plm(data, y ~ x1 + c1 + c2 + c3 | inst + c1 + c2 + c3, effect = "twoways", model = "within", index = c("City", "Year"), inst.method = 'baltagi')
summary(fit_plm)
This works, but there is no statistical diagnostics at all.
- fixest
fit_fixest = feols(data, y ~ c1 + c2 + c3 | City + Year | x1 ~ inst)
summary(fit_fixest)
There is diagnostics. But the output result of this model is COMPLETELY different from that of my plm model above. I am really confused.