Tips for Using IPUMS (USA or International) Files
This describes my method for working with IPUMS data. Other methods may work just as well.
Importing Data
- Make a list of the variables you need. Always include household and person number, so that each person is uniquely identified.
- I usually leave filtering observations for later. This way, the data can be reused for other projects.
- Create an extract (see IPUMS website). Download it. The
extract comes as an undelimited text file with SAS and SPSS programs to
load it.
- Modify the SPSS (or SAS) program so it can load the file
(change the path to the "dat" file in the first line). Run the program
to load the file into SPSS.
- Write a program that breaks the file into variables. For
each variable you need a SAVE TRANSLATE statement. Now you have a set
of files such age "age.txt" One for each variable. Each row is a person.
Filter and Import into Matlab
- In Matlab: Loop over the variables and import each into a "mat" file. This is simply a load/save operation.
- Start with variables used for preliminary filtering. Create
a variable that is 1 for persons passing the filter and 0 otherwise.
- Then loop over all variables and import those passing the filter. Save them as numbered variables.
- Write a recode function for each variable. At least you want consistent missing value and topcoding codes.
Tip: Read a book on good programming practices before you start. I like "Writing Solid Code."
|