|
Try something like this (untested):
data want;
set have;
by sid;
retain after;
drop after;
if first.sid then after = 0;
if not after;
if dv=1 then after = 1;
run;
On Sun, 23 Nov 2003 18:35:26 -0600, praxis <praxis6887@YAHOO.COM> wrote:
>Hello,
>
>I want to build a event history type of data using this data set.
>
>id sid wave dv iv1
>1 1 1 0 1
>2 1 2 1 1
>3 1 3 0 1
>4 2 1 0 2
>5 2 2 0 1
>6 2 3 1 1
>7 3 1 1 1
>8 3 2 1 2
>9 3 3 0 1
>
>Even though each of three individuals has data from 3 waves, I need to take
>such cases as "id" 3, 8, and 9 out of this data set because these cases
were
>observed after the "event" was occurred (i.e., dv= 1). It would be nice if
>there is a way to control or use case number into the code, but I don't
>know. Please help.
>
>Thanks in advance.
>Jinseok
|