Hi! I'm new to SAS and I'm struggling with a descriptive analysis that requires some knowledge about SAS dates. I hope someone here can help me: I have a dataset with individuals that are on medications during different time periods. They have also reported the adverse effects that they experience. I want to study the number of adverse effects reported for each week on medication. For each individual I have a medication period (e.g. 2001-03-01 to 2001-03-28). The actual dates for the medication period varies between individuals. I also have variables that contain each adverse effect and it's date (e.g. 2001-03-10, one adverse effect; 2001-03-21; one adverse effect; 2001-03-27; one adverse effect etc.). If there are two adverse effects on the same day, they are reported separately on two different rows. 1. What I would like to do is transform each individual's medication period into medication weeks starting from week 1, (i.e. the first week on medication would be week no. 1, the second week on medication would be week no. 2, the third week on medication would be week no. 3 etc). 2. Then I would like to match each reported adverse effect to it's respective week. So that I, for each individual, would get something like this: Individual 1 Medication week 1: 0 adverse effect. Medication week 2: 0 adverse effects. Medication week 3: 1 adverse effects. Medication week 4: 1 adverse effects. Individual 2 Medication week 1: 3 adverse effect. Medication week 2: 6 adverse effects. Medication week 3: 5 adverse effects. Medication week 4: 0 adverse effects. Medication week 5: 0 adverse effects. Medication week 6: 0 adverse effects. And so on for each individual. So, how do I convert the medication periods into weeks and how do I match the dates for the adverse effects with these weeks? Thanks! Kind regards, Amelie
... View more