thanks for that
, but it didn't really work. It gives a "1" in the record where event001=1 and the next one.
It should be in all the next lines with the same PATCOD (not necessarily where Event001=1)
I'm not familiar with the command LAG(variable), I should educate myself...Is there a clear explanation available for this on the net?
What I've done in the mean time is very complex and prone to mistakes (see below) . Can you see an obvious mistake?
SORT CASES BY PATCOD Birthdate .
*than computed a new variabel
COMPUTE PREV2adm3=EVENT001.1 + EVENT001.2.
COMPUTE PREV3adm4=EVENT001.1 + EVENT001.2 +EVENT001.3.
*than restructurated it back
/MAKE PREVV FROM PREV0adm1 prev1adm2 PREV2adm3 PREV3adm4
RECODE PREVV (0=0) (1 thru Highest=1) INTO Pr_event.