Hi,
I have a dataset looks like the following. What I want to do is to identify observations with exactly the same id, diagnose and t (observations noted in bold), and among them only keep the observations appearing at the first time in the dataset.
This is what I expect to get (aka. the red observations in the above table should be removed):
Could anyone help with this? thank you very much in advance!
Best,
Z
I have a dataset looks like the following. What I want to do is to identify observations with exactly the same id, diagnose and t (observations noted in bold), and among them only keep the observations appearing at the first time in the dataset.
id | diagnose | t | age |
1 | ssc | 0 | 22 |
2 | ssc | 0 | 67 |
2 | ibd | 1 | 55 |
2 | ssc | 0 | 24 |
2 | tb | 0 | 78 |
2 | tb | 1 | 35 |
3 | ssc | 0 | 64 |
3 | ssc | 0 | 42 |
3 | ibd | 0 | 53 |
This is what I expect to get (aka. the red observations in the above table should be removed):
id | diagnose | t | age |
1 | ssc | 0 | 22 |
2 | ssc | 0 | 67 |
2 | ibd | 1 | 55 |
2 | tb | 0 | 78 |
2 | tb | 1 | 35 |
3 | ssc | 0 | 64 |
3 | ibd | 0 | 53 |
Best,
Z
Comment