Hello,
I am trying to identify specific sets of consecutive dates by individual over the course of several years. I can calculate the length of stay between two dates, but I would like to generate (and add new rows/observations) for the days in between date1 and date2.
For example:
ID START END DURATION
1 2013-11-27 2013-11-29 3
I would like to have an expanded dataset that can list specific days, from var START:
ID START END DURATION
1 2013-11-27 2013-11-29 3
1 2013-11-28 2013-11-29
1 2013-11-29 2013-11-29
The expand function will only give me:
ID START END DURATION
1 2013-11-27 2013-11-29 3
1 2013-11-27 2013-11-29 3
1 2013-11-27 2013-11-29 3
The goal is to identify days, consecutive "in-hospital" days - versus - single-visit days. My thinking is that if I can identify each unique "in-hospital" day, then I can categorise and calculate them appropriately.
Any suggestions or alternative approaches would be greatly appreciated!
Thank you.
I am trying to identify specific sets of consecutive dates by individual over the course of several years. I can calculate the length of stay between two dates, but I would like to generate (and add new rows/observations) for the days in between date1 and date2.
For example:
ID START END DURATION
1 2013-11-27 2013-11-29 3
I would like to have an expanded dataset that can list specific days, from var START:
ID START END DURATION
1 2013-11-27 2013-11-29 3
1 2013-11-28 2013-11-29
1 2013-11-29 2013-11-29
The expand function will only give me:
ID START END DURATION
1 2013-11-27 2013-11-29 3
1 2013-11-27 2013-11-29 3
1 2013-11-27 2013-11-29 3
The goal is to identify days, consecutive "in-hospital" days - versus - single-visit days. My thinking is that if I can identify each unique "in-hospital" day, then I can categorise and calculate them appropriately.
Any suggestions or alternative approaches would be greatly appreciated!
Thank you.
Comment