data one;
input id par $ ady;
datalines;
1 a 3
1 a 6
1 a 9
2 a 6
3 a 3
3 a 4
4 a 4 4 a 8
5 a 7 5 a 10
6 a 5 6 a 12
;
Dear
I need to create a variable 'want' based on 'ady' variable values.
If ady contains at least one of the values (3,6,9,12 or 15,18,21,24) in any record by id and par then for the subject want='Yes'; else want='No'
output needed;
id want
1 Yes
2 Yes
3 Yes
4 No
5 No
6 Yes
for id= 4 and 5 the subjects do not have records with values (3,6,9,12 or 15). So want='No'.
Please suggest. Thank you
... View more