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.
Related Posts with quick help on identifying the first admission date
Simple by() and 'if' questionI'm working with some historical data on NFL players. I want to create a dummy variable indicating w…
A loop to predict a log-modelFor the model, Y= Yt-1+X1t+X2t+X3t+e I want to create a loop to predict future values such that the …
cond() functionHi all! I have the following dilemma. I would like to create variables such that: if a local takes…
Need for a permutation test ?Hi, STATA people, I have 12000 observation. I want to randomly assign a fake treatment value of 1 t…
remove certain string chars if in beginning of string var onlyDear Statalist, I have been searching for ways to remove a sequence of characters from a string var…
Subscribe to:
Post Comments (Atom)
0 Response to quick help on identifying the first admission date
Post a Comment