Dear All, Suppose that I have the data
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str8 var1 str20 var2 float wanted
"A" "A,G,H" 1
"B" "B,D,H" 1
"C" "E,P,Z" .
end
The `wanted' variable is what I want. It is defined as follows. If the value/text in `var1' appears in `var2', wanted = 1, . (missing value) otherwise. Any suggestions are highly appreciated.