Dear Statalisters,

I've got a (probably very easy) problem and I'm somehow blind for the answer..

I'm using the vallist statement (I know there are several other statements which produce simlar results, but in no one I'm getting it right..) to write out a local, in which my value labels are included. There are two options, of which one writes the values into a r(list) (option nolabels) and otherwise, the value labels.

For example:

Code:
vallist risk
No Yes

vallist risk, nolabels sort local(val)
di "`val'"
1 2
Now I need a new local which includes only the value, which belongs to "Yes", in this case the value 2. Is there a possibility to get this?

Thanks a lot for your help,
Anna