Hey there,

I have a dataset consisting of the two variables below (ID-number and admission date) with a total of approx. 15.000 entries. A majority of the patients have been readmitted more than once so there is multiple admission dates for the same ID-number (as shown below). As one of my first steps, I want to create a new variable identifying the first admission for each ID-number. So if a patient has been readmitted more than once, I am only interested in their first admission as a basis for further analysis. I am a bit lost on how to approach this, so any help or tips would be much appreciated.

Many thanks in advance.

Bjørn

ID-number admission date (date variable)
00002678 04/02/2013
00002309 23/03/2011
00002309 08/12/2012
00002309 03/02/2013
00001988 27/05/2017
00006783 12/10/2014
00006783 17/04/2018
00002890 25/12/2019
00009764 11/07/2011
00003432 17/04/2014
00003432 21/06/2014
00003432 29/07/2014
etc.