Announcement

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

  • Xtset and fixed effects

    Hi all, I am trying to run a panel model with fixed effects for year and state. If you xtset your data, does that automatically include fixed effects for those variables, or do you need to include dummy variables as well? In other words, which model is correct?

    xtset state year
    xtnbreg DV IV

    or

    xtset state year
    xtnbreg DV IV i.state i.year

  • #2
    Emma:
    welcome to this forum.
    If you want to capture the so called time fixed effect too, you shoud write:
    Code:
    xtset state year
    xtnbreg DV IV i.year
    Please note that -xtnbreg- calculates conditional fixed effect (which are different from the fixed effect calculated via -xtreg-).
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Hi Carlo,
      Thank you so much for your response! To clarify, how does

      xtset state year
      xtnbreg DV IV i.year

      differ from

      xtset state year
      xtnbreg DV IV, fe ?

      In my models, when I run xtnbreg DV IV, fe, the model converges, but if I try to run xtnbreg DV IV i.year, nothing happens.

      Comment

      Working...
      X