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


Is there a way that I can convert a DAT file to a STATA file? If so, how is t...
Underlying files for CPS Education Supplements (October)?
Income varialbe values & US variable
Why there is no data for 'VLHALLORG"
.CVS format data uploaded into EXCEL
County Codes
Login   |   Register

Recently Active Members

View More »

Share |