Dear All,

suppose I have the following data:

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float(var1 var2 var3)
102 123 0
102 137 1
102 158 0
102 158 0
102 158 0
137 102 1
end
As you may notice var1 and var2 contain the same values in two cases, although they are inverted (row2 contains 102 and 137, while row6 contains 137 and 102) Indeed, I would like to generate a new variable (var3) which is 1 if such a situation occurs and 0 otherwise.

Unfortunately, I could not came out which any good solution. Do you have any suggestion? I hope to have explained my case in a clear way.

Thanks in advance for any help.

Dario