I’m having trouble merging countyfips in IPUMS with countyfips in CDC. I understand I should merge statefip with county fips in IPUMS— but how exactly do I do that?
It looks like the CDC uses the 5 digit FIPS coding system, where the first two digits are the state FIPS codes and the last three digits correspond to the county FIPS codes.
Using IPUMS USA data, as you noted, you will need to combine STATEFIP with COUNTYFIPS to merge the two. Alternatively, you could split the CDC FIPS variable into two variables. Either method can be done in a statistical tool. For example, using Stata, the following would produce a combined STATEFIP/COUNTYFIPS variable:
gen str5 cdc_fips_match=string(statefip, “%02.0f”)+string(countyfips, “%03.0f”)
If you are using IPUMS USA data from 1950 onward, keep in mind that counties are unavailable. This spreadsheet contains counties which are identifiable by other methods from 1950 onward.