Hello. In a dataset like this:
I need to create a variable this_is that indicates which variable, x1 or x2, matches in value with z
In this case, the result should be:
How can I do it? Thanks
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(x1 x2 z) 10 20 20 34 14 34 end
I need to create a variable this_is that indicates which variable, x1 or x2, matches in value with z
In this case, the result should be:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(x1 x2 z) str2 this_is 10 20 20 "x2" 34 14 34 "x1" end
How can I do it? Thanks
Comment