Dear All, I found this question here (
https://bbs.pinggu.org/thread-7419648-1-1.html). The data is
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str14 address str1 name int test
"A company" "A" 1
"B company" "B" 1
"C company" "C" 1
"D company" "" 0
"G company" "" 0
"BD company" "" 1
"E company" "" 0
"AF company" "" 1
end
Given `address' and `name', I'd like to define a dummy `test' which is equal to 1 if the company name in `address' matches any one of elements of `name', 0 otherwise. Any suggestions are highly appreciated.
0 Response to matching one variable with another variable?
Post a Comment