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.
egen new_id= group (id firm)
but it doesn't work (xtset still gives me that error). Many thanks for your attention.
Comment