Dear all, Below is an example of the dataset I am working with. I am trying to combine dates within a week of each other per ID. I have tried using lag and have been able to create a flag for records that have dates within a week of each other but am encountering an error when one person can have multiple records with multiple separate dates within a week (If that makes sense). I think I need to somehow create a unique ID again and cluster the data but I am a bit lost. ID Date Test 1 Jan 1, 2005 0 1 Jan 2, 2005 1 2 Jan 1, 2005 0 2 Jan 2, 2005 1 2 Feb 1, 2005 1 2 Feb 3, 2005 1 3 March 2, 2005 1 3 March 3, 2005 1 4 April 10, 2006 1 My goal would be to have the end data (using max of tested and min of date), look like this: ID Date Tested 1 Jan 1, 2005 1 2 Jan 1, 2005 1 2 Feb 1, 2005 1 3 March 2, 2005 1 4 April 10, 2006 1 Thank you for any help or consideration,
... View more