Hi why does stata return the error when i run this code
using the following dataset:
As you can see I have successfully run the code here (post 7)using fake data... and I do have repeated years in my variables found in this post, but I didn't obtain the error obtained above. May you please let me know what I'm doing wrong?
https://www.statalist.org/forums/for...n-var-f-status
Update:
it turns out I have around 12 people who died and had the operation on the same day (using the full ddmmyy)
I wouldn't like to lose this data by just dropping them....as this shows a procedure may be high risk
How do I address the problem to allow me to use -xtset-
Code:
sort ptid year2 xtset ptid year2 //ERROR: repeated time values within panel
using the following dataset:
Code:
clear input float(ptid state year2) 1 1 2003 1 2 . 1 3 . 2 1 2003 2 3 2018 2 2 . 3 1 2003 end label values state q1 label def q1 1 "primary", modify label def q1 2 "revised", modify label def q1 3 "dead", modify
https://www.statalist.org/forums/for...n-var-f-status
Update:
it turns out I have around 12 people who died and had the operation on the same day (using the full ddmmyy)
I wouldn't like to lose this data by just dropping them....as this shows a procedure may be high risk
How do I address the problem to allow me to use -xtset-
Comment