Question

Status:Closed    Asked:Nov 10, 2015 - 01:47 PM

Any thoughts on how to apply the codebook formatting to the dataset using R, XML, or SQL?

I don't have access to SPSS, SAS, or STATA. Would love your input. Note: I'm prepared to write custom code to rebuild the existing basic codebook.

 
Do you have the same question? Follow this Question
 

Staff Answer

avatar

Tim_Moreland

Staff

Here is one common method for reading formatted IPUMS data into R:


(1) Select "STATA" as your data format on the extract request screen. This will generate a .dta file when you submit your extract.


(2) In R, use the following code with the name of your .dta file:


library(foreign)

df <- read.dta("ipums_file.dta")


This reads your IPUMS file into a dataframe named "df" with value labels applied. I recommend this resource for more information on using IPUMS data in R.


Hope this helps.

 

Nov 10, 2015 - 05:26 PM

1
0
Report it

Answers

Thanks Tim,


The following update to your answer worked perfect:


install.packages("readstata13")

library(readstata13)

df <- read.dta13(file = "./some_dir/some_file.dta")

 

Nov 12, 2015 - 10:51 AM

0
0
Report it

I wrote a set of Bash/AWK scripts to transform the data and load it into SQLite. Details here: https://github.com/ericnystrom/napptools

 

Nov 13, 2015 - 08:41 AM

0
0
Report it

OTHER QUESTIONS NEEDING ANSWERS

CPS Volunteer Supplement 2002-2015 - Differences between vlstatus and vlhallo...
JTYEARAGO coding?
Info on non-primary occupation in CPS?
When did IPUMS-CPS start like the way (easily downloadable way) like now?
Replicate weights for use with CPS-TUS
Longitudinal cohort in TUS 2014/2015?
Login   |   Register

Recently Active Members

View More »

Share |