Status:Closed    Asked:Oct 07, 2015 - 11:29 AM

What are the numeric codes for countries on IPUMS? For example, if I want to drop a country from sample on STATA.

I need to clean the data I have on STATA by looking at what countries may not necessarily have the data I am looking for. I am a STATA beginner. I want to be able to make commands to drop countries, but simply writing: drop if country==Indonesia does not work since i am guessing each country has a numeric code. I've used tab country, no label to see codes but these are not recognized. For example, it seems like Argentina's code is 32 but if I type: drop if country==32, 32 is considered unrecognized. Thanks in advance for your help!

Do you have the same question? Follow this Question

Staff Answer




You can find the numeric country codes here. Your STATA syntax for dropping a country is correct (drop if country==32). I recommend double-checking that your STATA code exactly matches this syntax. Also, confirm that you have not inadvertently changed the data type of the COUNTRY variable from numeric to string, which would cause an error of "32 not found".

Hope this helps.


Oct 07, 2015 - 12:56 PM

Report it


I am looking for the Kessler 6 variable in IPUMS-MEPS
Reason for missing MIGSTA1 values in ASEC files for 1985 (and 1995)
India Area-level data (geo2) inconsistent for total population, urban share, ...
Does anyone have a method for handling missing data in CPS "EDUC" variable? 2...
How do I find the data file:Ipumsi_00001.dat for the 1974
Variables from Full Year Consolidated Files currently not included in IPUMS-M...
Login   |   Register

Recently Active Members

View More »

Share |