# R: felm function with an interacted IV

I want to interact an IV variable with a non-IV variable and be able to add fixed effects with the felm function (the library is lfe).

I have 3 variables in my function, D (indicator variable), tau (indicator variable), and rc (continuous variable). D is endogenous and tau is exogenous, in the final equation it should be:

$f0&space;=&space;\alpha_0&space;+&space;\alpha_1&space;*&space;D&space;+&space;\alpha_2&space;*&space;rc&space;+&space;\alpha_3&space;*&space;D&space;*&space;rc$

Where D is instrumented by tau. Doing this in the AER package with ivreg is easy, ivreg(f0 ~ D*rc | tau*rc, data=df), but in felm I can't figure it out.

My current best guess is

felm(f0 ~ 1 | 0 | (D*rc ~ tau*rc), data=df)


Which at least doesn't give an error, but the coefficients are completely different.