Do you have a dataset where countries are encoded using, say, ISO 3166 three-digit numeric codes, and you want to produce a table of EU member states as of, say, 1995—in, say, Chinese? This turns out to be quite easy with Ben Jann’s excellent crosswalk package and my own suite of crosswalk tables.
Assuming the required packages are installed, here is an example of how this works. First, let me load some example data where countries are encoded using ISO 3166 three-digit numeric codes. The file kountry.dta from Raciborski’s kountry package provides exactly this.
Now, using crosswalk with crosswalk-countries, we can generate two variables that record the year each country entered the EU and, where relevant, the year it exited:
These variables allow us to create an indicator for EU membership in a given year. I’ll use 1995, as in the earlier example, but any other year could be used as well:
Finally, we need to convert the numeric country codes into a string variable in Chinese. For this, we can again use crosswalk together with crosswalk-countries:
And here's the table:
You can use other languages (Arabic, English, German, French, Spanish, Russian) other organizations (African Union, International Court of Justice, OECD, etc.), geographical regions, and of course many other country coding systems.
Installation of (most recent) crosswalk by Ben Jann:
Installation of crosswalk tables for countries is a bit more cumbersome since the number of files exceed the number of files Stata's package management can handle. I recommend:
This installs the package into the personal Ado directory. You may want to choose another directory if you don't want the package for your entire account.
Assuming the required packages are installed, here is an example of how this works. First, let me load some example data where countries are encoded using ISO 3166 three-digit numeric codes. The file kountry.dta from Raciborski’s kountry package provides exactly this.
Code:
. use _ISO3N_ using http://www.stata-journal.com/software/sj10-4/dm0038_1/kountry.dta, clear
Code:
. crosswalk join = cntry.iso3n_to_eu(_ISO3N_ 1) . crosswalk quit = cntry.iso3n_to_eu(_ISO3N_ 2)
Code:
. gen eu = join <= 1995 & quit > 1995
Code:
. crosswalk name = cntry.iso3n_to_name_zh(_ISO3N_)
Code:
. tab name if eu
name | Freq. Percent Cum.
----------------------------------------+-----------------------------------
丹麦 | 1 6.67 6.67
卢森堡 | 1 6.67 13.33
大不列颠及北爱尔兰联合王国 | 1 6.67 20.00
奥地利 | 1 6.67 26.67
希腊 | 1 6.67 33.33
德国 | 1 6.67 40.00
意大利 | 1 6.67 46.67
比利时 | 1 6.67 53.33
法国 | 1 6.67 60.00
爱尔兰 | 1 6.67 66.67
瑞典 | 1 6.67 73.33
芬兰 | 1 6.67 80.00
荷兰王国 | 1 6.67 86.67
葡萄牙 | 1 6.67 93.33
西班牙 | 1 6.67 100.00
----------------------------------------+-----------------------------------
Total | 15 100.00
Installation of (most recent) crosswalk by Ben Jann:
Code:
. ssc install crosswalk
Code:
. cd "`c(sysdir_personal)'" . net from https://gitup.uni-potsdam.de/ukohler/crosswalk-countries/-/raw/main/ . net get crosswalk-countries . unzipfile crosswalk_countries_cwfcn.zip, replace

Comment