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


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 |