Announcement

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

  • Fixed effects for ID in a linear regression?

    Hi all,

    Just a rather simple question that I can't get my head around. I have a dataset in a long format with around 1000 IDs. About 200 of them occur two times (the collection of the data was over two years), while the rest are only included once. I want to make a linear regression (not a panel regression), but how should I control for the recurring IDs? Should I include fixed effect for ID, or is it better to include fixed effect for year?

    Best,
    Marcus

  • #2
    Markus:
    the issue here rests on your dataset, not on the methods.
    That said, if you want to go -regress- under a presumed -fe- specification, you should add both -panelvar- and -timevar- categorical predictors and, with 200 out of 1000 IDs with 2-wave data, this approach is totally inefficient.
    Therefopre, i'd go:
    Code:
     xtset panelid timevar
    xtreg <depvar> <indepvars> <controls> i.timevar, fe vce(cluster panelid)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X