Dataset activate yourdata.
Dataset declare pervisit.
Aggregate outfile = pervisit
/break = Id visit
/antidepressant = First (antidepressant)
.
Dataset activate pervisit window = front.
Jim Marks
Dear Listserv,
I have a data file:
ID Visit antidepressant
101 1 name
101 1 name
101 2 name
101 4 name
102 1 name
102 1 name
.
.
.
.
Could someone please help me create syntax so that each ID will only have 1 line of data for a visit.
For example, I only want ID 101 to have one line for Visit 1, 2, and 4. At this point I do
not care about the name of the drug. I just want to know whether a subject was on a antidepressant
at each of their visits.
Many thanks for your help in advance,
leah