Hi there,
I am using stata12 and working on a panel dataset with two years (2002 and 2005). I have appended the years together, but due to attrition, some observations do not appear in the 2005 year. Also, new observations have been added to the 2005 year. I would like to drop all these observations and only keep the observations that appear in both years. What commands should I use to keep only the required observations as explained?
I have attached an extract of my data.
Thank you very much for your attention. And please let me know if I am not clear enough.
I am using stata12 and working on a panel dataset with two years (2002 and 2005). I have appended the years together, but due to attrition, some observations do not appear in the 2005 year. Also, new observations have been added to the 2005 year. I would like to drop all these observations and only keep the observations that appear in both years. What commands should I use to keep only the required observations as explained?
I have attached an extract of my data.
Code:
case_id YEAR TOTAL_INCOME 010404207 2002 1534.416 010404207 2005 80 010404208 2002 0 010404208 2005 5000 010404290 2005 1447.602 010404301 2002 3665.751 010404301 2005 710 010404302 2002 1330.23 010404302 2005 785.9066 010404303 2002 950.0001 010404303 2005 7957.208 010404305 2002 300 010404306 2002 500 010404306 2005 23572.12 010404307 2002 1507.841
Comment