Hello all,

I've seen the helpful responses here and since I can't quite seem to find the right solution for my problem, I figured I'd go ahead and ask. Relatively new to Stata (I'm using Stata 13) and to this forum, so apologies in advance if I've mistakenly failed to follow any posting guidelines.

I'm working with a dataset that includes a variable "unique_id" (numeric) to identify individual respondents to a phone survey. There are multiple instances of some 'unique-id's if a person was contacted more than once.

What I'm trying to do is, if a certain unique_id meets a separate criteria (if the value of variable q_14 == 1) in any one instance, drop every other instance of that unique_id. I'd prefer to keep the observations of the unique_ids where q_14==1, but if I have to just drop all instances of that particular unique_id, that should be OK. I just want to drop all unique_ids if there is any instance of q_14==1 for that unique_id.

In the example data below, I'd want to drop all instances of unique_id 30000 and 40000 where q_14 does not equal 1:

unique_id q_14
10000 1
20000 1
30000 .
30000 .
30000 1
40000 .
40000 1
50000 .
60000 .

Please let me know if there is a way to clarify what I'm looking for, and thank you very much in advance for any advice!