Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: matching observations for merging
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: matching observations for merging
Date
Thu, 17 Jun 2010 09:11:14 -0700 (PDT)
--- I wrote:
<snip>
> This will display a list of troublesome country names, which is
> usually so short that it doesn't pay to do anything more fancy.
>
> With this list you can create a recode .do file which harmonizes
> country names before the final merge.
<snip>
Here is are the relevant lines of such .do file I created for such
a project 7 years ago. Notice that part of the problem is not just
spelling, but also that countries change (split up or merge), and
this .do file also implements my assumptions on how to deal with
those changes.
replace country = "Antigua and Barbuda" if country == "Antigua & Barbuda"
replace country = "Bosnia and Herzegovina" if country == "Bosnia-Herzegovina"
replace country = "Cameroon" if country == "Cameroun"
replace country = "Côte d'Ivoire" if country == "Ivory Coast"
replace country = "Democratic Republic of the Congo" if country == "Zaire"
replace country = "Kyrgyzstan" if country == "Kyrgyz Republic"
replace country = "Libyan Arab Jamahiriya" if country == "Libya"
replace country = "Luxembourg" if country == "Luxemburg"
replace country = "Madagascar" if country == "Malagasy Republic"
replace country = "Republic of Korea" if country == "Korea,South"
replace country = "Republic of Moldova" if country == "Moldova"
replace country = "Romania" if country == "Rumania"
replace country = "Russian Federation" if country == "Russia"
replace country = "Saint Kitts and Nevis" if country == "St. Kitts-Nevis"
replace country = "Saint Lucia" if country == "St. Lucia"
replace country = "Saint Vincent and the Grenadines" if country == "St. Vincent and the Grenadines"
replace country = "Suriname" if country == "Surinam"
replace country = "Sao Tome and Principe" if country == "Sao Tome-Principe"
replace country = "Serbia and Montenegro" if country == "Yugoslavia"
replace country = "Syrian Arab Republic" if country == "Syria"
replace country = "Tanzania United Republic of" if country == "Tanzania"
replace country = "The former Yugoslav Republic of Macedonia" if country == "Macedonia"
replace country = "Viet Nam" if country == "Vietnam, Dem. Rep. of"
replace country = "the Islamic Republic of Iran" if country == "Iran"
replace country = "United States" if country == "United States of America"
replace country = "Germany" if country == "German Federal Republic"
replace country = "Yemen" if country == "Yemen Arab Republic"
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/