I have a dataset containing dates of treatment for cancer patients. A patient can have radiation, surgery, brachytherapy, hormone treatment, or no treatment. I need to find the first treatment that occurred in a time window of diagnosis date + 180 days to diagnosis date + 3 years, then determine the sequence of all other 'first' treatments that occurred within 1 year after the first treatment and construct a variable that indicates the treatment sequence within this time window.. My dataset looks like this: patient ID dxdate first_rtdate first_surgdate first_btdate first_htdate 1 01JAN2008 01JUN2008 . 01MAY2008 2 01MAY2004 01MAY2009 15JUN2004 01SEP2004 01JUN2004 3 01SEP2003 01MAR2004 01DEC2003 15SEP2003 4 01JUL2005 15JUL2005 5. 01OCT2001 01OCT2007 6. 01JAN2002 15JUL2002 15JUL2007 7. 01NOV2009 01DEC2009 01DEC2013 What I need to end up with is a variable for treatment sequence, including the first treatment, within this first treatment-365day window that looks like patient ID txseq 1 HT,RT 2 HT,SURG,BT 3 HT,SURG,RT 4 HT 5. NO TREATMENT 6. RT 7. NO TREATMENT I'd be very grateful for any help! Thank you
... View more