Announcement

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

  • Slow generating interaction FE

    Hi all,

    I'm trying to add commuting zone-occupation FE to my regression. What I tried to do is:
    1) generate the interaction term:
    [/CODE]
    gen cz_occ_fe=cz*occ
    [/CODE]
    2) put it in reghdfe
    [/CODE]
    reghdfe y x, absorb(cz_occ_fe)
    [/CODE]
    But since I have 740+ commuting zone, and 968 occupation, it took me forever to generate the interaction term (I'm already using a powerful server).
    Is there anyway to make things faster?

    Thank you

  • #2
    Yes, there is: Factor-variable notation. You can include the interactions with this notation directly into the absorb() option of reghdfe.
    https://www.stata.com/links/stata-ba...able-notation/

    Comment


    • #3
      Originally posted by Andreas Backhaus View Post
      Yes, there is: Factor-variable notation. You can include the interactions with this notation directly into the absorb() option of reghdfe.
      https://www.stata.com/links/stata-ba...able-notation/
      Hi Andreas,

      Thanks, it works perfectly.

      Comment

      Working...
      X