Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ivreghdfe interaction term!

    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!!



  • #2
    Many user written procedures do not allow all the options that Stata-provided procedures do. You'll probably have to generate the interactions manually and include them in the estimation explicitly. Note that any margins analysis will need to set consistent values of the main effect and the interactions.

    Comment

    Working...
    X