I am new to stata and need help in the following :
| Variable 1 ( ID) | Variable 2 (color) | 
| 1 | red | 
| 1 | red | 
| 2 | blue | 
| 2 | green | 
| 3 | purple | 
| 4 | red | 
Within duplicates of ID , I want to drop the IDs where the duplicates are different in color but keep IDs that have duplicates with the same color .
i.e.
I want to drop both duplicates with ID 2 because one is blue and the other is green
I want to keep duplicates for ID 1 because both duplicates have red color
Thank you !
0 Response to Dropping a duplicate in variable 1 if it was also different in variable 2
Post a Comment