Dear all,
I have a small issue I cannot seem to figure out.
I have a panel dataset with country-level variables (e.g., exports in services).
I am attaching a screenshot below.
I am trying to add ISO numerical codes for each country (dyad) that I will need later on to match values with other datasets.
How can I recode or add these codes as separate variables? In other words, for each country I would like to have a separate variable called "iso_num_a" that gives the ISO number of the reporting country and the "iso_num_b" that gives the ISO number of the partner country. I have the country identifiers but I would rather not do this manually...
If you see the dataset below, essentially I would like to have a variable where AUT (Austria) will be equal to 40 and BEL (Belgium) will be equal to 56.
The country variable (iso3ca) and the partner variable (iso3cb) are both string variables.
I hope I explained this well...
Any suggestions?
Thanks,
Aydin

I have a small issue I cannot seem to figure out.
I have a panel dataset with country-level variables (e.g., exports in services).
I am attaching a screenshot below.
I am trying to add ISO numerical codes for each country (dyad) that I will need later on to match values with other datasets.
How can I recode or add these codes as separate variables? In other words, for each country I would like to have a separate variable called "iso_num_a" that gives the ISO number of the reporting country and the "iso_num_b" that gives the ISO number of the partner country. I have the country identifiers but I would rather not do this manually...
If you see the dataset below, essentially I would like to have a variable where AUT (Austria) will be equal to 40 and BEL (Belgium) will be equal to 56.
The country variable (iso3ca) and the partner variable (iso3cb) are both string variables.
I hope I explained this well...
Any suggestions?
Thanks,
Aydin
Comment