|ICPSR Gateway | GovInfo Gateway | © SSRIC Glossary|
UMBC Workshops - sponsored by CIRC (the Center for Interdisciplinary Research and Consulting)
Before you BeginThe first thing you should know about SPSS is that it is NOT a wordprocessing or spreadsheet program. It is a tool for interpreting rectangular data, and is based on command line programming. When data in files are arranged in rows and columns, it is called cases-by-variables, or rectangular data files.
Furthermore, while you don't need to understand statistical terms, tests, and equations to use SPSS, the results will mean little to you without that knowledge.
Types of files extensions you may encouter and what they mean (roughly):
- SPSS portable (*.por): This format can be read by versions of SPSS on other operating systems (for example, Macintosh or UNIX);
- SPSS (*.sav): SPSS format. If you can find one of these to use you are usually in good shape. When you create data sets of your own you'll be saving files in the .sav format;
- Tab-delimited (*.dat): Most data files you download have some sort of delimination, e.g., tab, comma, space. Sometimes it's easier to import this sort of data into Microsoft Excel before importing into SPSS;
- SPSS (*.sps): This file extension denotes a syntax file. Hint: you don't open a syntax file, you run it. Trust me, this bit of knowledge will keep you from tearing your hair out. You run syntax files to read raw data (*.dat files) into SPSS;
- Other files: Such as Excel (*.xls) and dBase (*.dbf).
For this exercise I have created a data file in Excel with thirty students' test scores (idea from Carol Walker at ISU). I have left out several steps that should be fairly obvious to anyone who uses Windows on a regular basis.
- Download the sample file (iqtests.xls) --I suggest saving it to the desktop
- When you view the file in Excel you can see that it is composed of seven columns: id, gender, age, school, IQ, math, lang and opinion. You can also see that some variables, gender for instance, are represented by numbers. You'll be coding those variables once you import this file into SPSS
- a window will launch giving you several options. For now, close that window by clicking Cancel
Making changes in the Variable View
- Editing Labels
- Click the Variable View tab
- Click the cell in which the math row intersects with the Label column
- Type "Math Exam" in that column
- Repeat to add other labels
- Editing Values
- Click the Variables View tab
- Click the cell in which the gender row intersects with the Value column
- Click the grey square with the elipse (...)
- Type "1" in the Value box and hit Tab
- Type "Female" in the Value Label box and click Add
- Repeat for school and Opinion of own IQ
- Editing Measure
- Click the Variables View tab
- Click the cell in which the opinion row intersects with the Measure column
- Choose Ordinal from the pull-down menu
- Note: Measure Values
- Scale: represents discrete or continuous values along a range, e.g., age, iq, math, and lang are all scale values;
- *Ordinal Variable: A measurement that allows a sample of individuals to be ranked with respect to some characteristic but where differences at different points of the scale are not necessarily equivalent, e.g., Opinion of own IQ
- *Nominal Variable, aka Categorical variable: a variable that gives the appropriate label of an observation after allocation to one of several possible categories, e.g., gender (1 OR 2), school
Now here's the real power of SPSS. This also where you need to have some knowledge of statistics to understand what your results mean. Let's forge ahead and do some data analysis on the IQ file.
*Descriptive Statistics:A general term for methods of summarizing and tabulating data that make their main features more transparent.
- Analyze > Descriptive Statistics > Descriptives
- A "Descriptives" box will open; move items from one side to the other by highlighting the values and clicking the arrow button. Note: Ordinal variables won't make sense as general descriptives
- Click OK and SPSS generates an output screen. You can save this as output (*.spo). You can also copy and past the tables (and graphs) into a wordprocessing document. For now, leave your results and move to the next topic.
- Analyze > Descriptive Statistics > Frequencies
- Choose variables that will represent meaningfully as frequencies
- Click the Statistics button
- Choose "Median" and click continue
- Click the Charts button
- Choose a chart and click continue
- Click Paste...You've created a sytax (*.sps) file! --for more information on syntax files see below
- Run > All
Below are step by-step-instructions for using syntax files
- Make sure you know where the the data file(s) and SPSS syntax file are located;
- Start SPSS for Windows;
- File > Open > Syntax
- Choose the SPSS syntax file (probably beginning with SP) and click OK. The *.sps file will open on your screen;
- You need to make ONE change to the syntax file. Scroll down in the syntax file past the introductory notes to a line that begins either FILE HANDLE or DATA LIST FILE=. Whichever one of these you see, you will see a FILE='filename' statement. This is what you need to change. Within the single quotes (or after the = if there are no quotes), you must have the correct location for your data file.
- E.g., DATA LIST FILE='d:\9774\d9774p1.dat'
- In older versions of SPSS the last line of your syntax file must be EXECUTE. (period included). Version 10.0.5 seems to work fine without it, but if you're using an older version make sure to include this command.
- Run > All
- If the operation was successful, you should see the newly labelled and imported data in the Newdata window (which should be chooseable from the task bar). Also, your Output window will display error messages if you have any errors in your syntax file.