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


Can I study multiple countries? One country?
Can I download data from all of the countries at once, and then have the extr...
In selecting data, is it all possible to select Scandinavian countries? I do ...
How do I drop repeated records if I combine 9 months of CPS Basic Monthly Dat...
Login   |   Register

Recently Active Members

View More »

Share |