fixed effect, instrumental variable regression like xtivreg in stata (FE IV regression)
Question
Does anyone know about a R package that supports fixed effect, instrumental variable regression like xtivreg
in stata (FE IV regression). Yes, I can just include dummy variables but that just gets impossible when the number of groups increases.
Thanks!
Solution
I can just include dummy variables but that just gets impossible when the number of groups increases
By "impossible," do you mean "computationally impossible"? If so, check out the plm
package, which was designed to handle cases that would otherwise be computationally infeasible, and which permits fixed-effects IV.
Start with the plm
vignette. It will quickly make clear whether plm
is what you're looking for.
Update 2018 December 03: the estimatr
package will also do what you want. It's faster and easier to use than the plm
package.
OTHER TIPS
As you may know, for many fixed effects and random effects models {I should mention FE and RE from econometrics and education standpoint since the definitions in statistics are different}, you can create an equivalent SEM (Structural Equation Modeling) model. There are two packages in R that can be used for that purpose: 1)SEM 2) LAVAAN
Another solution is to use SAS. In SAS, you can use Proc GLM which enables you to use "absorb" statement which automatically takes care of the dummies as well as finding (x - xbar) per each observation.
Hope it helps.
Try the ivreg command from the AER package.