Hi Statalisters,
I'd appreciate your help with a data formatting problem I'm trying to solve.
I'm working with longitudinal data (multiple rows per subject). I want to split the data into intervals of equal length (30 days), starting from the study entry date until the study exit date, taking into account the multiple rows per subject.
My data looks like this:
DoE is the date of entry into the study
DoX the date of exit
dob is the date of birth
admidate is the date of admission
Each individual can have multiple admissions. I'd like to split the data so that an admission flag appears in any time interval where an admission occurred.
Could someone please advise on the best way to do this?
Any help would be much appreciated.
Thanks.
I'd appreciate your help with a data formatting problem I'm trying to solve.
I'm working with longitudinal data (multiple rows per subject). I want to split the data into intervals of equal length (30 days), starting from the study entry date until the study exit date, taking into account the multiple rows per subject.
My data looks like this:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(myid DoE DoX dob admidate adm_ind) 1 18263 23375 5395 18281 1 1 18263 23375 5395 19511 1 1 18263 23375 5395 19554 1 1 18263 23375 5395 19762 1 1 18263 23375 5395 19764 1 1 18263 23375 5395 20049 1 1 18263 23375 5395 20251 1 1 18263 23375 5395 21682 1 end format %d DoE format %d DoX format %d dob format %d admidate
DoE is the date of entry into the study
DoX the date of exit
dob is the date of birth
admidate is the date of admission
Each individual can have multiple admissions. I'd like to split the data so that an admission flag appears in any time interval where an admission occurred.
Could someone please advise on the best way to do this?
Any help would be much appreciated.
Thanks.
Comment