Status:Closed    Asked:Jan 28, 2018 - 09:29 PM

R package 'ipums' can't read extract. Needs .XML file? No option for that???

Trying to use the ipumsr package in R to read a CPS extract file. Seems to need an extract file with .XML extension. That format is not presented as an option. Using the .dat or the .dat.gz files do not work. What to do?

Do you have the same question? Follow this Question

Staff Answer

I think the issue may be that you attempted to read in a .csv file. According to the documentation, you should rely on the zipped .dat file as well as the .xml DDI file (found under "Codebook" in your list of extracts). Additionally, make sure you save both files to your working directory.

If you have the correct files and they are in the correct location, the following code will work (keep in mind that what I have as "cps_XXXXX.xml" should be changed to match the name of your extract).

cps_data <- "cps_XXXXX.xml"
ddi <- read_ipums_ddi(cps_data)
data <- read_ipums_micro(ddi)


Jan 29, 2018 - 08:55 AM

Report it


How Do I Link Husbands & Wives in 1974 & 2008 Liberian IPUMS Samples to Study...
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
Login   |   Register

Recently Active Members

View More »

Share |