Hello,

I'm using ivreghdfe and need to interact my instrument with a categorical variable. Could someone explain how to do this? My regressor is x, the instrument is w and the categorical variable is state.

I tried:
Code:
ivreghdfe y (x=z)*i.state, r cl(district) a(district)
but that doesn't work.
I also tried to create the interaction as a variable but I'm not sure how that's useful. If I run
Code:
interaction_x=x*state
interaction_w=w*state
the variables have weird values since state has values from 1 to 50. Also, using i.state doesn't work!
Code:
interaction_x=x*i.state
interaction_w=w*i.state
I'd appreciate your help. Thank you!!