Hi all,
I have a dataset containing over 300'000 observations and have identified a few (1'725) duplicates that need to be combined for me to continue my analysis. I would like to merge each duplicate into one so that the final observation keeps the maximum value for each variable, would anyone know how to do this?

So I have for example:
Obs# Year CompanyName var1 var2 var3
1 2002 A 150 . 52
2 2002 A 22 35 48
And I would like to end up with (for each of my duplicates):
Obs# Year CompanyName var1 var2 var3
1 2002 A 150 35 52
Thanks in advance!