Hello everyone,
I am a new stata user and I have a problem with my data set. Maybe it's quite easy for you experts or it has already been discussed in this forum, but I've been searching for a solution almost the whole day without any success. I have several thousand annual firm year data and the problem that there are many year duplicates. Usually, the duplicate has only missings or at least more missings for the numeric variables. The duplicate is not always the first observation, so that e.g. sort year ; duplicates drop year, force does not work. Furthermore, I want to delete only year duplicates within a specific firm id, but the by prefix does not work for duplicates drop.
The following table shows an example of my data set where I e.g. would like to delete observation 4.
Observation Firm_ID Year Sales
1 912 2006 3,320
2 917 2005 1,123
3 917 2006 1,341
4 917 2006 .
Do you know any smart solution for this problem?
Thank you!
TM
I am a new stata user and I have a problem with my data set. Maybe it's quite easy for you experts or it has already been discussed in this forum, but I've been searching for a solution almost the whole day without any success. I have several thousand annual firm year data and the problem that there are many year duplicates. Usually, the duplicate has only missings or at least more missings for the numeric variables. The duplicate is not always the first observation, so that e.g. sort year ; duplicates drop year, force does not work. Furthermore, I want to delete only year duplicates within a specific firm id, but the by prefix does not work for duplicates drop.
The following table shows an example of my data set where I e.g. would like to delete observation 4.
Observation Firm_ID Year Sales
1 912 2006 3,320
2 917 2005 1,123
3 917 2006 1,341
4 917 2006 .
Do you know any smart solution for this problem?
Thank you!
TM

Comment