Hello,

I have the following data below:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(ID start end)
2 18080 18747
2 20702 21335
2 18748 23011
2 21336 23011
end
format %td start
format %td end
Within ID’s, I want to properly order the data so that the previous end date is one day less than the next start date. The data should look like this:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(ID start end)
2 18080 18747
2 18748 23011
2 20702 21335
2 21336 23011
end
format %td start
format %td end
If this cannot be achieved within ID, then I would like to create separate groups for those cases.

I would appreciate any assistance.

Thanks,
Anoush K.