Hi,
I have a dataset with multiple timepoint measurements for the same ID. For each unique ID, I need to keep only the earliest observation and delete the rest. How can I code this?
Additionally, using the example below, how can I fill in the missing value for the 'sex' variable at timepoint 1 with the value from timepoint 2?
Thank you!
ID | Timepoint | Sex |
0001 | 1 | |
0001 | 2 | Female |
0001 | 3 | Female |
0002 | 2 | Male |
0002 | 3 | Male |
0003 | 2 | Male |
0003 | 4 | Male |