Downloading ICPSR Stata "System" Files

For most of the studies in the ICPSR's archive, the data are distributed in the form of large ASCII files with "setup files" that take the ASCII data and turn them into SAS or SPSS data files. Fortunately for Stata users, however, a small but growing number of ICPSR studies now include Stata "system" files. A "system file" is, to quote the ICPSR's glossary of social-science terms, "[a] generic term for the native or internal storage format used by statistical software." A Stata "system" file, then, is another term for a Stata data file. Unlike ASCII data files, Stata system files do not require editing .do files or data dictionaries to get the data into Stata. And, unlike SPSS portable files or SAS transport files, there is no need to run any "import" procedure to read the data into the program. Basically, all you need to do is download the file from the ICPSR and open it up in Stata.

Here, we will use ICPSR #4262 for illustrative purposes:



Click here for full-size image

Click on the "Download Data" tab. You will be taken to the ICPSR MyData Login page. All ICPSR users are required to have accounts if they wish to download data, so you will need to set one up if you do not have one already. Enter your email address 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, SPSS, and Stata as well as a SAS "transport" file, an SPSS portable file, and a Stata "system" 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 Stata Setup Files" or "Stata System") or download all the available files for a particular study. Whichever files you select 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 at the right and download files one at a time. For our purposes, we only want the Stata system file, so we will choose this last route. Click on the "download individual files" link and you will be taken to this page:



Click here for full-size image

If you scroll down some, you will see that a Stata system file is available and ready to download:



Click here for full-size image

To save the system file, right-click on the "Stata system" link and choose "Save Target As...":



Click here for full-size image

Save the Stata system file in the desired location on your computer and be sure to add ".dta to the end of the filename - the "Save as Type" field should be either "All Files" or "Stata Dataset" (either option will work - just make sure you attach the .dta extension). Here, we'll save the data file as "st4262-Data.dta":



Click here for full-size image

[Note that, when we are saving the file, we are not using the default file name (i.e. 04262-0001-Data.dta) that the ICPSR assigns. Instead, we are using an older ICPSR convention for naming files, mainly because the resulting file name is shorter. How you wish to name the files is up to you - just be careful about what file extension you specify.]

And, that is basically it - now, you can access the system file via Stata's -use- command and Stata will open it up:



Click here for full-size image

Click here for full-size image

With some ICPSR studies, the Stata system file is accompanied by a "supplemental" .do file that will perform additional tasks such as creating and attaching value labels or setting codes for missing values in the data. You can run one of these supplemental files as you would run any Stata .do file by choosing the "Do..." option under Stata's "File" menu and browsing to the .do file. Then, you can highlight the file and click on the "Open" button and Stata will execute the contents of the .do file. Running the supplemenal file, however, is often not necessary for the purposes of preparing the data for analysis.




Data Analysis

Page adapted from Electronic Data Center, Emory University Libraries
Original text by Özlem Elgün