I am performing a regression on panel data, with country FE.
However, one of my explanatory variables is probably endogenous.
Thus, I would like to use an instrumental variable approach to be able to compare with the standard linear approach (i.e. to be able to perform a Hausman test).
My question is: how do I create a Instrumental Variable model with fixed effects (in my case, individual fixed effects) on R ?
I know how to create fixed effects on panel data (using plm), how to create/use instrumental variables (slightly harder - could use ivreg or systemfit)... But how do I combine the two ?
the instruments are specified after the | sign (both exogenous explanatory variables [x2 in that case] and the instruments [z1] should be included after that sign). More information on the CRAN - Panel Data Econometrics in R.
(search for the header " Instrumental variable estimators").