Announcement

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

  • panel regression with country group year fixed effects

    Hi everybody,

    For my research, I need to do multiple FE with panel data.

    the dependent variable is group-level, Independent variables is country level.

    So I tried

    reg y x i.group i.country i.year

    it response with not sorted, can't proceed.

    Only in this circumstances is possible to proceed:

    egen ID = group(country group)
    xtset ID year
    reg i.group i.year i.country

    I am not sure did I formulated the right code.

    Thanks

  • #2
    Seng:
    your -fe- regression can be easier with -xtreg,fe-.
    By the way, you do not have to -xtset- your dataset if you go -regress-.
    If you're interested in n-way -fe- you should consider the community-contributed module -reghdfe-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      reghdfe y x , absorb(country year)

      you should think about collapsing the data to the country level if all your X's are country level.

      Comment

      Working...
      X