Hello,
I am currently aiming to create an identification variable in order to identify the flight route of an observation. Therefore I would like to generate a variable combining two string variables (Origin and destination). Normally I could of course do this with
gen citypair = origin_city + dest_city
The problem with this is that it gives you the following result:
Both observations however service the same route, so I would like to identify both observations with an identical identifying citypair value.
Any suggestions on how to do that?
Thank you in advance,
Frank
I am currently aiming to create an identification variable in order to identify the flight route of an observation. Therefore I would like to generate a variable combining two string variables (Origin and destination). Normally I could of course do this with
gen citypair = origin_city + dest_city
The problem with this is that it gives you the following result:
origin_city | des_city | citypair |
NY | WA | NYWA |
WA | NY | WANY |
Any suggestions on how to do that?
Thank you in advance,
Frank
Comment