Question

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

avatar

Tim_Moreland

Staff

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

0
0
Report it

OTHER QUESTIONS NEEDING ANSWERS

USA IPUMS 1980 ancestry variable -- mapping to country names
Did the version of database change since 2011?
Are DATANUM, SERIAL, and PERNUM the same in single-year and 5-year ACS sample...
How can I accurately calculate the median family income by state for families...
Detailed Variables Dropping From Dataset
Are weights adjusted when using "select cases" in an extraction?
Login   |   Register


Share |