data want;
infile cards dlm=',';
input ID MonthYear Event1_date1 Event1_date2 FEvent_date1 time2event2 time2event2_mth;
cards;
1, 1, 3000, , , 60, 2
1, 2, , , , 60, 2
1, 3, 3060, , 3100, 60, 2
1, 4, , , , 60, 2
2, 8, 2090, 3040, , 50, 0
2, 9, , , 50, 0 2, 10, , , 3190, 50, 0
3, 1, 2935, 2945, 2965, 10, 0
3, 2, , , , 10, 0
; so I would be hoping for something like this- where the variables for time2event2 and time2event2_mth are added. Time2event2 would calculate the difference between the first date value and the second largest date value for that id and the time2event2_mth would calculate the change in monthyear_r2 variable between the two dates. sorry for the confusion- does that make sense? / is this possible?
... View more