Extracting Data from the GSS
Extracting Data from GSS
- Go to: http://hdl.library.upenn.edu/1017/9086
- Click on Download at the top of the screen.
- Click on "customized subset."
- Leave Data File checked, leave Codebook checked, and where it says Data Definitions for check SPSS.
- Look at the part marked Select Cases that asks for "Selection filters". Here is where you specify that you are only interested in studying those cases that meet a certain criteria. For instance, extract only those cases where the respondents are male [sex (1)] or the year of the survey was 1998-2004 [year (1998-2004)].
- Enter name of variables to include. You should have used one of the codebook indexes to identify variables for extract with or without your own created variables. You have two ways to select variables for extraction -- either type the variable name in the top section, or choose all or some of the variables from the groups listed in the bottom section. If you choose "some" you will be prompted to choose which variables in the next screen.
- When you have selected your cases and variables, you can review them and then click "Create the Files".
- The system will create 3 files here. It might also let you know that it could not find some of the variables you were looking for if the variables you seek weren't used in the years you request or you used an incorrect variable name.
Downloading the Three Files
- Right click on the data file and save it with the name data.txt to a place on your computer where you'll be able to find it again.
- Right click on the codebook file and save it as codebook.txt in the same location.
- Right click on the SPSS file and save it as syntax.sps. Change the file type to All Files. Save in the same location.
Bringing the Data into SPSS
You should be starting this part with three files on your computer, one of which is a codebook, one of which is a raw data file, which just looks like a lot of numbers, and one of which is the syntax file, which tells SPSS how to read the data in the data file.
Here is a step by step tutorial describing how to bring the data into SPSS. audio only
- Double click on the syntax file and it will open in SPSS. If it does not automatically open in SPSS, open SPSS separately, then go to the File Menu, choose Open, select Syntax, and find the file on your computer.
- Now you should be looking at a syntax file. It is a set of instructions that tells SPSS what the numbers in your raw data file mean. Find the section that says
DATA LIST fixed records=1
FILE="x" /* Replace 'x' with full path name of your input data file.
- Replace x with the full path name of your file.
In my case it should say:
DATA LIST fixed records=1
FILE="C:\Temp\gss\data.txt"
/*NOTE: if you don't know the path to your file, navigate to the file from your desktop, right click on the document and look at the properties. You can copy most of the path name from the location there. Add \data.txt after the location if you named your file "data.txt". - At the very bottom of the syntax file, you see two more comments for you. One tells you to rename y to identify the name of your outfile. The other one asks you if you want it compressed or not. Change y to a simple name. Delete the last line.
- Now, at the top of your syntax file, go to Run--> All.
- Sit back and wait for SPSS to read your data.
- Once that's done (it may take a little while), save the data as an SPSS .sav file so you don't have to do this part again.
Laurie Allen
Research and Instructional Services Librarian
Van Pelt Library
215-573-3232
laallen@pobox.upenn.edu
Research and Instructional Services Librarian
Van Pelt Library
215-573-3232
laallen@pobox.upenn.edu



