I have a dataset with multiple individuals, which are registrered with observations of a specific procedure of various length, some individuals have several of these procedures conducted and are thus registrered with several observations for the same id number. The procedures are registrered with a start and end time in SIF (proc_start and proc_end). Seperate observations for single individuals may however overlap in time, and these can be considered one single procedure.
How do I combine observations with identical id and overlapping procedural times to one observation with the maximal procedural duration (from the first procedure start to the last procedure end), while leaving procedures not overlapping in time as separate observations?
I hope one of you can help. I have found the solution in R but not in STATA which I use.
How do I combine observations with identical id and overlapping procedural times to one observation with the maximal procedural duration (from the first procedure start to the last procedure end), while leaving procedures not overlapping in time as separate observations?
I hope one of you can help. I have found the solution in R but not in STATA which I use.
Comment