I have a large dataset with patient encounters, of which some patients may have had multiple encounters, and I only want to include their FIRST encounter. I'm trying to figure out how to drop duplicate variables such that for each duplicate, the one with the lowest age is the only one that's included. For example, if I have the following dataset
ID age
1 4
3 3
2 1
1 5
2 2
3 4
4 2
3 5
4 4
I want to convert it to:
ID age
1 4
2 1
3 3
4 2
Is there a way to do this using a the duplicates command? Or a different command?