Announcement

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

  • Repeated time values within panel (r451)

    Hello everyone, I am really new in Stata and I'm trying to work with a panel data. I know that, to set a panel data, one uses xtset id year, but when I try to use this command Stata returns the error "repeated time values within panel (r451)". I know that this happens because I have the same id repeated in the same year (for instance Mark appears several times within 2011). It happens because in my panel, the same id works in several companies. My goal is to keep these multiple observations because I need it (so I must not remove duplicates). How can I do it? I have tried to do:

    egen new_id= group (id firm)

    but it doesn't work (xtset still gives me that error). Many thanks for your attention.

  • #2
    If you admit that you have multiple observations of the same individual in a year, then you do not have panel data. You can xtset with the individual identifier only, and this should be sufficient provided that you are not using time-series operators such as leads or lags.

    Code:
    xtset id

    Comment

    Working...
    X