Hi All, I have a new question regarding collapsing consecutive dates. For my study I am looking at antibiotic prescriptions. I have already determined the patients who would have been given a single primary antibiotic. However, now I have to address those individuals who would fall into the mixed therapy category. For these individuals I want to collapse the start and stop dates for antibiotics given on consecutive dates. In addition to collapsing to a single date, I need to retain the antibiotic given on those dates (see example below). ID RX_1 RX_2 Start_1 Start_2 Stop_1 Stop_2 New_Start New_Stop New_RX_1 New_RX_2 1 1 2 5/2/2001 5/3/2001 5/2/2001 5/3/2001 5/2/2001 5/3/2001 1 2 2 1 3 5/2/2001 5/2/2001 5/2/2001 5/2/2001 5/2/2001 5/2/2001 1 3 However, not all individuals will have multiple treaments that can be collapsed into one set of consecutive dates. In those cases I need a data set that will look something like this ID RX_1 RX_2 Start_1 Start_2 Stop_1 Stop_2 New_Start1 New_Stop1 New_Start2 New_Stop2 New_RX1_1 New_RX1_2 New_RX2_1 New_RX2_2 3 1 2 5/2/2001 5/10/2001 5/2/2001 5/19/2001 5/2/2001 5/2/2001 5/10/2001 5/19/2001 1 2 The overall data set has up to 8 different prescription (RX), start, and stop dates that have to be collapsed. Thanks, Jonathan
... View more