Hello!
I am looking to generate two new string variables based on the relative alphabetical position of two other variables, wherein the first new variable comes first alphabetically and the second comes second. For an example I would like to turn this:
V1 V2
Apple Orange
Tree Biscuit
Sad Happy
Beef Brain
into this:
V3 V4
Apple Orange
Biscuit Tree
Happy Sad
Beef Brain
in Stata. Does anyone have any suggestions?
I am looking to generate two new string variables based on the relative alphabetical position of two other variables, wherein the first new variable comes first alphabetically and the second comes second. For an example I would like to turn this:
V1 V2
Apple Orange
Tree Biscuit
Sad Happy
Beef Brain
into this:
V3 V4
Apple Orange
Biscuit Tree
Happy Sad
Beef Brain
in Stata. Does anyone have any suggestions?
Comment