Hi,
I am a SAS beginner.
My dataset with 4,000 observations looks like this
id startyear endyear exposure1 exposure 2 exposure 3
id1 1985 1987 1 0 0
id2 1992 1997 1 0 0
id2 1998 1999 0 1 0
id2 2000 2007 0 0 1
id3 1996 2007 0 0 1
id4 1987 2008 1 0 1
The ids are duplicated if the id (person) has reported different time periods for exposures.
I need to calculate the cumulative exposure, and I need the ids unique, but keeping the exposure information (to be able to sum them). How can I transform the data so that different exposures in different time periods become variables instead of different observations?
(Maybe the columns looks weird, but the 1 and 0 are supposed to be under the column headings "exposure1.. etc")
Thanks,
Maxi74
... View more