Hi. I have a dataset with neary one million individuals and their hospitalizations (> 1 hospitalization over time for each individual). How can I create a new, smaller dataset extracting only the last hospitalization for each individual? The variable 'hosp_id' has values from 1 to 25

Thank you in advance
Gerhard