Announcement

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

  • Adding interaction term to xtreg

    Hi everyone! We are researching the impact of sanctions on balance sheets of russia's banks. to look further into the relation with the profit/loss ratio, we want to see if the coefficient/change in driven by interest income (defined as NetInterestIncome). To do this, we think we need to add an interaction term to the command, but we are not sure how to do it. The 'basic' command without interaction is:

    xtreg winsor_PLTaxratio logTA winsor_NetIncRatio winsor_NetInterestIncRatio winsor_TotalEquityRatio sanction_x_POST_NEXT POST_NEXT i.Year i.Bank_ID, fe cluster(Bank_ID)

    Thanks a lot!!

  • #2
    Hey Daan,

    if possible provide example data for your code such that people can try things on their machine. In your term it looks a little like there is already a (manually coded) interaction term (sanction_x_POST_NEXT). At least that is how people often would name their interaction terms.

    Anyway, in principle there are two ways to include an interaction term (partial due to better readability):

    Code:
    * Factor notation
    xtreg winsor_PLTaxratio i.sanction##i.POST_NEXT
    
    * Manually coded
    gen interaction = sanction*POST_NEXT
    xtreg winsor_PLTaxratio sanction POST_NEXT interaction
    If there is already an interaction term you need to do a triple interaction following either of the two approaches.

    Best
    Sebastian

    Comment

    Working...
    X