|
Preparing ICPSR Data in OSIRIS for Use with SAS/SPSS/Stata
Most ICPSR data sets have command files for reading the raw data files into
SAS or SPSS
(or, with some more recent studies, Stata). For many older files in the ICPSR's archive, however, the data are
in a format called OSIRIS,
which is no longer in use. When ICPSR files are in an OSIRIS format, they will have a data dictionary listing
the variables, their names, and their locations in the raw data file. Oftentimes, ICPSR data files with OSIRIS
dictionaries will also have SAS or SPSS data-definition statements, and we recommend that you use the latter when
they are available because they are more likely to include value labels and such than are OSIRIS data dictionaries.
Sometimes, however, an OSIRIS data dictionary will be all that is available. This guide will walk you through how
to convert OSIRIS data files into other, usable formats via StatTransfer.
(1) Start by downloading the datafile and OSIRIS data dictionary from the ICPSR website for the study you
want. Here, we're using ICPSR #7201:

Click here for full-size image
(a) Click on the "Download" tab. You will be taken to an "Authorized Download - Emory University" page that will
ask you for the username and password for your ICPSR account - all ICPSR users are required to have such accounts
if they wish to download data, so you will need to set one up if you do not have one already. Enter your
username and password and, once you have been authenticated, you will see something like the following
screen:

Click here for full-size image
The ICPSR presents users with multiple options for downloading data. Generally speaking, the ICPSR will have
files available for different statistical packages. Here, for instance, there are ASCII data and setup files
available for SAS and SPSS. There is also a "Data Map/Dictionary" file, which is the OSIRIS dictionary file.
[You can get additional detail about the files available for a study by reading the file manifest that is
available on the "Description" page.] You can download just those files for a particular program (e.g. "ASCII
Data File and SAS Setup Files") or download all the available files for a particular study. Whichever files you
choose will then be added into your "data cart" for download. If you go the data-cart route, you will be
downloading a zipped archive of whatever files you chose. Alternately, you can click on the "download individual
files" link and download the files one at a time. For our purposes, we only want the raw ASCII data file and
the OSIRIS dictionary, so we will choose this last route. Click on the "download individual files" link and
you will taken to this page:

Click here for full-size image
(b) First, we will save the raw data file. Right-click on the link titled "Data" and choose "Save Target As ..."
to save the data into a directory on your hard drive:

Click here for full-size image
(c) You must change the file type as 'All Files' and give the datafile a name with extension .dat at the end.
This .dat extension is necessary if the OSIRIS dictionary is to successfully read the data. Here, we'll save the
raw data with the name "da7201.dat":

Click here for full-size image
[Note that we are not using the default file names that the ICPSR assigns. Instead, we are using an older ICPSR
convention for naming files, mainly because the resulting file names are shorter. How you wish to name the files
is up to you - just be careful about what file extension you specify.]
(d) Next, save the OSIRIS dictionary file in the same location where you saved the data file. This file is necessary to
transfer the raw data file into a usable
format. The name of the dictionary file must be the same as the name of the datafile. Otherwise, StatTransfer will not be
able to read the data into your desired format. However, the dictionary file needs an
extension of either .dic, .dict or .dct (any of these should suffice). Once again, we need to change the file
type to "All Files." Here, we'll save the dictionary file with the name "da7201.dic":

Click here for full-size image
(2) Open StatTransfer from the Start Menu or desktop icon.
(a) Select 'input file type' to be OSIRIS;
(b) Browse to your directory and find the dictionary file you downloaded from the ICPSR website (Note: do not select
the datafile. StatTransfer uses the OSIRIS dictionary file to transfer data, so that is the file you should select in
StatTransfer.);
(c) Then select the format you want to transfer the data into in the 'Output file type' box (in this example, we are
converting the file into a Stata format). The filename will automatically be filled in and will have the same name
as the OSIRIS datafile, only with the appropriate extension. The new file will be saved in the same directory.

Click here for full-size image
(3) Then click on the "Transfer" button and your new, non-OSIRIS, data file will be created in your
directory:

Click here for full-size image
This guide was updated in the summer of 2005 to reflect changes in the ICPSR website and in how users can
download data. An earlier version of this guide is available here
and provides guidance for how to work with OSIRIS dictionaries compressed via GZip (a compression program used
in Unix/Linux environments).
If you have any questions or would like extra assistance, please feel free to
contact the Data Center staff.
|