Professional Documents
Culture Documents
Presented by:
Computer Services
No part of this publication may be used or reproduced in any form without prior written permission
of Computer Services.
This manual provides introductory instructions for the use of SPSS. The
training materials do not cover all the features and components of the software, but
focus on the basics of what SPSS is used for and how to “get around” in it.
Although some statistical concepts are covered in our SPSS workshops, the
materials are not intended to serve as a reference for basic statistics, but help
familiarize the user with some of the terminology you encounter in the use of the
software. The materials include resources from:
Topic Page
Statistics Overview 3
SPSS Terms 6
Introduction 9
Examining/Editing Output 24
Work With Output in Outline Pane
Work With Tables in Display Pane
Work with Charts in Display Pane
Shortcut Keys 30
Accelerator Keys in Data Editor
Keys While in Edit Mode
Dialog Box Commands
Data Editor Keys
Viewer Window Keys
Accelerator Keys in Chart Editor
Exercise 37
If you have collected your statistical data on standard scan sheets, you may
want to have the responses scanned into a data file at Computer Services. You can
then download the file from your MUSIC directory to your desktop and read the
data into SPSS for your statistical work.
In order to create statistics, you must measure what you want to analyze.
(Remember: data is a measurement of some occurrence or event.)
• Determine the data type for each variable in a case.
• Once data type is established, you can select a suitable statistical procedure.
• To analyze data a certain way, you must collect it a certain way!
Data is treated in SPSS in one of two general ways, then further processed
according to its measure (scale, nominal, or ordinal).
Statistically significant means that data allows us to reject the null hypothesis (There is
no difference or pattern or relationship present shown in the data.) There is a “switch
value” called the critcal or significant level by which significance is determined. If the
switch is set at .05 (five percent chance) or .01 (one per-cent chance), then a significant
To look at it another way, the significance level (or p-value) is the probability of
randomly obtaining results as extreme as the one observed.
• If the significance level is very small (less than 0.05) then getting the same results by
chance is rejected and the data pattern/relationship/difference is supported.
• If the significance level is relatively large (for example, 0.50) then getting the same
results by chance is supported and the data pattern /relationship /difference is
rejected.
Correlations
• A correlation is a relationship. In SPSS, you check for the relationship between two
or more variables.
• A strong linear correlation is indicated by a correlation coefficient close to 1 or –1.
• Correlation coefficients may be between –1 and 1 where:
o -1 indicates a perfect negative linear relationship.
o 1 indicates a perfect positive linear relationship.
Even if the correlation between two variables is not significant the variables may be
correlated but the relationship may be nonlinear. Before calculating correlations, plot a
scatterplot of the two variables to see how they are related.
Linear Regression estimates the coefficients of the linear equation, involving one or
more independent variables, that best predict the value of the dependent variable. For
example, you can try to predict a salesperson’s total yearly sales (the dependent variable)
from independent variables such as age, education, and years of experience.
Active window – window in the foreground, When new syntax or viewer window is
opened, that window is both active and designated.
Case – one observation, similar to a record in a database. For example, each respondent
to a questionnaire is a case.
Command pushbuttons – buttons that instruct SPSS to perform an action, such as run
the procedure, display Help, or open a sub-dialog box to make additional specifications.
Data Editor – window that displays the contents of the working data file in a spreadsheet
format. This window opens when you start an SPSS session.
Designated window – syntax or viewer window that receives output or action, indicated
by an exclamation point (!) in the status bar (dimmed when designated, enabled if not).
You can change the designated windows by clicking on the (!) button. The designated
window does not have to be the active window (the window in the foreground).
Missing values – data files may have missing values for certain variables, There are two
ways missing data are determined and processed appropriately by SPSS:
System-missing – empty data cells for non-string variables are defined this by
default
User-defined – the user must define the missing data indicators for SPSS
Nominal – “measured by name only” data that has no intrinsic order. Nominal data can
be numeric or string. You can use numeric data to represent categories, like yes/no
answers.
Ordinal – “measured by rank” data, Data is considered ordinal when there is an intrinsic
rank or order to the possible values. In SPSS, strings and certain numerics can be
ordinal. (With strings, the order is alphabetic so use integers and variable labels for
ranking terms like low, medium, high.)
Outlier – data value that lies “outside” the general pattern or range of the other data
values for a variable
Scale – “measured by numeric value” on an interval or ratio scale, This requires numeric
data. Examples are age, income, height, etc.
Session – the actions and work done in SPSS from opening the program to exiting the
program
SPSS Files – files used and created in SPSS have different file name extensions. These
suffixes are appended by the Save action in SPSS. Tip: One way to organize your work
is to use the same file name for a single session’s data, output, and syntax.
Data files are saved with .sav as encoded text.
Output files are saved with .spo
Syntax files are saved with .sps
Production job files are saved with .spp
Journal files are saved with .jnl
TableLooks (table style set up) are saved with .tlo
Target variable list – one or more lists indicating the variables you have chosen for the
analysis, such as dependent and independent variable lists.
Transform – change the representation and/or use of data in existing variables through
the creation of new variables using functions or through recoding
Variable – reference object used to store separate data item in an observation. For
example, each question in a survey is a variable (i.e. something you measure, control, or
manipulate in research is a variable).
Variable type – the category of data values that a variable will hold, The default type is
numeric. The available data types are:
• Numeric – marked by (#) icon. The values are numbers and are displayed in
standard, decimal format. The data can be entered with standard or scientific
notation.
• String – marked by (A<) or (A>) icon, The values are alphanumeric group of 0 or
more characters, up to designated length of variable. Case is considered in value.
o Short strings (8 or less characters) - < subscript in icon
Viewer – window that displays the tables, statistics, and charts. This window opens
automatically when you run a command that produces output.
SPSS (Statistical Package for Social Sciences) was originally designed to run
on a mainframe computer with a file of command lines entered to generate and run
procedures for output. SPSS for Windows uses the “point and click” method to
automatically build a command file for the user. A file of these “built” commands (a
syntax file) may be saved for future use. So, for basic statistical needs, SPSS for
Windows automates any programming and program running.
SPSS is a high user of memory resources so exit all other programs unless it is
absolutely necessary to leave them active. SPSS will run more quickly and with less risk
of “crashing” due to lack of memory problems.
While developing a new data file and the different procedures you want done
with the data, it is easy to get “lost”, especially if you are running groups of
procedures on different data sets. File organization is very important and best
achieved through intuitive naming conventions and grouping. Develop a grouping
1. Get the data into the Data Editor. How and from where?
a. Open a saved data file.
b. Read a spreadsheet, text file, or database.
c. Enter the data directly into the Data Editor.
2. Select a procedure from the menus. Procedures can:
a. Create tables.
b. Calculate statistics.
c. Create charts.
3. Select the variables you want to use for the analysis.
a. Select variables from list in a dialog box.
b. The selected procedure processes the data in the variables.
c. The procedure displays the results in the Viewer.
4. Examine the results and determine their meaning.
The main windows used in SPSS are the Data Editor for data entry and the
Viewer for output. The other windows are usually opened from either the Data
Editor or the Viewer. You can have only one data file open at a time.
All the windows have these components with features appropriate to a specific window:
1. Dropdown Menu Bar (at top of window)
Menus allow you to select different files, statistics, charts, and actions.
2. Toolbars (dockable)
Buttons are shortcuts to actions available through menus
Toolbar components have pop-up descriptions.
3. Dialog Boxes (these open up for user input)
User selects variables or options for statistics and charts, etc.
(To get information on any of the controls in a dialog box, click the right
mouse button on the control you want to know about. A pop-up window
displays information about the control.)
4. Status Bar (at bottom of window)
Command – processed cases for procedure or command or iterations for
iterative statistical procedures message
Filter status – Filter On message for subset or random sampling
Weight status - Weight On message for use of a weight variable to weight
cases
Split File status – Split File message for data file that has been split into
separate groups for analysis, based on the values of one or more grouping
variables.
You can have several open Syntax and Viewer windows, but only one of each
type can be the "designated" one. The "designated" window should not be confused with
the "active" window. The “designated” Viewer window is the one to which new output is
routed, while the “active” window is the window currently in the foreground. To change
the designated window, make the selected window the active window and then click on
the exclamation point in the tool bar.
Fig.1 SPSS for Windows startup dialog box and Data Editor window
Look at Fig.2. The Data Editor window is a grid-type spreadsheet with two view tabs:
• Data View tab – Click on this tab to show all the data entries.
• Variable View tab – Click on this tab to show all the variables and their attributes.
When in Data View, the grid illustrates a basic data file structure where:
• A row is a single case (observation).
• A column is a single variable.
When in Variable View, the grid displays the list of variables and their attributes where:
• A row is a single variable.
• A column is a single attribute of that variable.
The Data Editor Toolbar - The toolbar buttons are used to do actions in fewer steps
than using the menu bar. (A button is dimmed if that action is currently not available.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2. Viewer window
This window opens automatically when output is first generated. Results are
displayed in the Viewer window (Fig. 3), which has two panes (outline and display).
You can pull already saved output (*.spo files) into the Viewer window. The outline
pane, on the left, shows the objects within the output as a tree of separate objects. The
display pane, on the right, shows the actual procedural output, the charts, tables, etc.
created from the data input into the procedures through the variables that you select.
You can:
• browse the output results with scrollbars.
• click on an item in the outline to go to/ select the corresponding table or chart in the
display pane.
• click and drag the right border of the outline pane to change the width of the outline
pane.
• click on the book icon by item in outline pane to toggle item between visible and
hidden in the display pane.
• format output for printing/saving as an output file or template file.
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9
You can define descriptive variable and value labels for data values. These labels can
be used to make your dataset more readable and enhance your output.
To display value labels in Data Editor window and use them to enter data:
1. Select Value Labels from the View menu or click on the Value Labels button on the
toolbar.
2. Click the cell where you want to enter the value.
To copy attributes to other variables (use standard Cut, Copy, Paste shortcuts):
1. Click on Variable View tab to activate it.
2. Highlight the cell for the attribute you want to copy.
3. Use Ctrl-C, then click in same attribute cell for the variable to which you want to
apply the attribute. (You can copy and paste into multiple cells also.)
(Note: You can copy all attributes of a variable by selecting the row, Ctrl-C, then paste
into a new row. A new variable is displayed with the same attributes.)
For Excel 5 or later files: if a column contains a mix of data types, the column items are
read as strings.
For Excel 4 or earlier files: if a column contains a mix of data types, the column items
are read as data type of first with value and data of other types set to system-missing (or
blank for string variables.)
1. Select File, then Open.
2. Select Data from the sub-menu.
3. Select the file type Excel (*.xls) from the drop-down list. Browse to find folder the
file is in, then select the file shown in dialog box window by double-clicking on it.
4. If the first row of the Excel file contains column headings or labels, click to place
checkmark by Read variable names from first row of data. (Note: For Excel 5 or
later, you can also specify the sheet in the Excel file that you want to read.)
• Column headings become variable names (up to first 8 characters)
• Column headings become variable labels.
3. The Text Import Wizard will open up with the text file in its preview window. If a
previously saved import format can be used, click beside the Yes option, click the
Browse button to find the format file (*.tpf), highlight the format file, then click the
Open button.
• If you need to define a new import format, click the Next button.
4. Click option buttons for variable arrangement and presence of names.
• Fixed format – data items are in aligned columns in text file
• Delimited – data items in record are ordered, not aligned, and record is
partitioned by delimiters (space, tab, or character). Consecutive delimiters
indicate missing data.
• Any descriptive labels in first row of file can be used as variable names.
5. Click Next button.
6. Click appropriate option buttons for case information.
• Data will start on second row if you used labels from the text file for variable
names.
• If not a case per line, click by option button and type in variables per case.
When all your data has been entered in the Data Editor (no matter where
you got it!) , you should SAVE it. This encodes the text in the necessary format for
use in SPSS. Any time you make changes to your dataset, you should SAVE the file.
1. Select File, then Save or click Save File button on toolbar.
2. Browse to folder where you want to save the file.
3. Type in an appropriate name for the file.
4. Click Save button.
5. SPSS will append the extension .sav for data files.
Once your data is in the Data Editor, you may want to generate other data,
dependent on the data in the Data Editor, or change the representation of the
existing data and include the new values in the analysis.
You may want to divide a dataset into different groups for analysis. You can
group on the values of up to eight variables. For example, you may want to group
by gender and ethnicity.
You may want to merge data files, making one dataset from two or more
data files.
For large files and repeated procedures, it may be useful to ‘cache” the data
so the procedures and data searching will run quicker.
1. After you select a procedure/graph from the Analyze or Graph menus or from the
Dialog Recall dropdown list, a dialog box will pop up.
2. Select the desired variables from the source list.
3. Use the arrow buttons to move selected variables into the target lists.
Note: Most procedures contain the minimum specifications on a single dialog
box. To modify analysis with optional selections, you select different options on
subdialog boxes that you open from within a dialog box.
4. Select any options you want processed.
5. Click on OK to run the analysis or chart process.
6. The results are then displayed in the Viewer window.
You can do some of the editing and arranging of your output by working
with them in the output tree shown in the Outline pane. Work done in the Outline
pane affects the contents of the Display pane.
To display variable names and data values instead of labels or display both names
and labels:
1. Select Options on the Edit menu in any window.
2. Select the Output Labels tab in the Options dialog box.
3. Change the settings for outline labeling or pivot table labeling.
To display variable names and data values instead of labels or display both names
and labels:
1. Select Options on the Edit menu in any window.
2. Select the Output Labels tab in the Options dialog box.
3. Change the settings for outline labeling or pivot table labeling.
Note: You can also change layers by selecting a category from the drop-down list.
You can put multiple table elements in the layer dimension.
Viewing a Chart
• After you create a chart, it is displayed in the Viewer.
• Any defined labels are automatically displayed in the chart.
• Descriptive variable and value labels make it easy to interpret your results.
Editing a Chart
You can:
• change the title, labeling, fonts, or colors.
• delete categories.
• change the scale, axis, or range.
• swap axes.
• change the chart type.
To insert a title:
1. Select Title from the Chart menu.
Press To
Press To
Press To
F4 Close window
F6 Next window
Up Arrow Up
control menu
Press To
Ctrl+F Edit>Find
Ctrl+O File>Option
Ctrl+P Print
Ctrl+S File>Save
Ctrl+Z Undo
F1 Help
B Activate control
D Activate control
E Activate control
F Activate control
G Activate control
H Activate control
I Activate control
J Activate control
K Activate control
M Activate control
O Activate control
P Activate control
Q Activate control
T Activate control
U Activate control
W Activate control
Y Activate control
Z Activate control
Exercise: Enter data directly into the Data Editor, import Excel and text files into
the Data Editor, save, merge, and split data files, paste into and run syntax file,
select variable for and run Frequencies procedure, create bar chart, and save and
print output file.
Note: In this session, save all your files as instructed in the SPSS folder in My
Documents.
To Launch SPSS:
1. Click on Start button.
2. Select Programs.
3. Select SPSS for Windows.
4. Select SPSS 10.0 for Windows.
5. Since the software is a client/server installation, it may take awhile to load the
application.
The Data Editor and dialog box (Figure 1 on pg. 12) is now visible.
************************************************************************
Just the Data Editor window is now visible. Click on Data View tab.
Note that the grid columns are all headed by ”var”. The rows are numbered
consecutively going down the screen. The upper left cell in the grid should now be
active (it will have a heavier border than the others) and ready for data input.
SPSS options can be set to apply to the entire session or to all sessions. We may
want to change some of these.
A session journal log is a record of the commands run in an SPSS session and can be
used later to reproduce a previous session.
6. Use Browse to specify the name of the journal file. Name it exercise1.
SPSS will append the .jnl extension. Click on Save button.
7. Make sure the Variable Lists area has Display Names and File selected.
8. Click Apply.
9. Click on Data tab. Right-click on the different objects to investigate the context of
the selections.
10. Click on Viewer tab. At bottom of Initial Output State area, place check mark by
Display commands in the log. Any commands will be displayed in the Viewer with
output for review.
************************************************************************
As you work through the data entry, refer to pg. 40 and 41f or Data Views and
Variable View. They show you the completed data entry and variable attribute
settings.
Data View
Values showing
While in Variable View, set the attributes for the other variables now. Look at the
questionnaire and think about what the variable types should be and what width or
decimal place to use for each of the variables.
While working…
To adjust the column widths so you can see all the headings:
1. Hover mouse pointer over right side of column heading until bar with double arrow
appears.
2. Hold left mouse down and drag left to narrow or right to widen column (you can
double-click to automatically widen to data and heading).
************************************************************************
Move to the first cell in the Label column. Here is where you input details of what
the variable stands for. The maximum length of a label is 256 (no restrictions on
characters).
To assign the labels for the variables: (You can press F2 key to enter edit mode for the
current cell.)
1. Type in Record Number.
2. Press down arrow key.
3. Type in Age last birthday.
4. Moving down the column, type in:
Gender (M for Male, F for Female)
What is your current GPA?
How many hours per week do you work for pay?
Now, enter the value labels for the variables, if appropriate. Remember: value
labels are descriptive substitutes for data values. The default entry is None.
Move to the top cell in the Missing column. The handling of missing data by SPSS is
VERY important. For example, there is the data item of 999 for a person’s age in a
To define how SPSS should treat the missing data for age:
1. Click on right side of second cell down in Missing column to activate … button and
open the Missing Values dialog box.
2. Click option button beside Discrete missing values.
3. Type in 999 in the first textbox. (SPSS allows 3 distinct values or a range and 1
distinct value to identify missing data.)
4. Click OK button.
5. Notice the 999 in the Missing attribute for the age variable.
Note: If entering missing values for string variables, the required value should
be enclosed in single quote (') marks, so an empty cell would be denoted by
''. Again, there is data missing for that variable in a file we will import.
************************************************************************
WARNING: If you have empty strings as missing values in string data, you must
use short strings (< 8 characters). You can’t define missing values or value labels
for long strings. Try to change the Width attribute of lastname to 9.
The Columns attribute designates how many characters wide the column for the
variable is in the Data View. This is useful when you have many variables and want
to show as many as possible when in Data View or in making a printout of the Data
View contents.
The Align attribute designates the alignment of the data within the cells holding the
data for the variable in the Data View. Note that the defaults are left for String and
right for Numeric data types.
The attribute Measure is used to define the measurement property of the variable.
Remember: SPSS has 3 categories for data values:
• Scale - processing values as actual scalars/numbers
• Ordinal - processing values as an ordered list
• Nominal – processing values as simply names
Move down the Measure column and determine the entry for each variable. Leave
recnum’s measure attribute as Scale (it could be any of the three).
You are done defining the variables. You can always return to Variable View and
change some of the attributes if the need arises. Now save your work.
************************************************************************
3. When you enter the values for gender, BE SURE to use uppercase F and M. (or you
can go back and redefine Labels to also use the lowercase values for gender).
4. Select View from menu, then click beside Value Labels.
5. Notice F has become Female, M is now Male… All the values with Value Labels
have been replaced with their labels.
6. Repeat Step 4. The values are back in the cells in Data View.
7. Compare with the data shown on pg. 47.
************************************************************************
Data entry can be very tedious. If data can be pulled from prior entries done in a
database or from a spreadsheet of data, the process is much easier. If survey data is
collected on scan sheets, a text file can be created that eliminates hand entry of the
data. For our exercise, we are going to import data from an ASCII text file and also
from an Excel file and save the data as separate files.
First, we will pull in the data from the Excel file. When completed, the Data Editor
contain seven cases.
Save the data in the editor as excel.sav. Review the instructions from above, if
needed.
3. The Text Import Wizard will open up with the contents of exercise1.txt in its
preview window. Since we need to define a new format, click the Next button.
(Formats can be saved for reuse if you have data files that use the same format.)
4. In Step 2, if needed, select option button for Delimited (data items in record are
ordered, not aligned, and partitioned by delimiters (a tab in this case). Consecutive
delimiters indicate missing data.
5. Click No to indicate there are no variable names at the top of the text file.
6. Click Next button.
Step 3
12. Repeat renaming process, in order from left to right, for age, gender, gpa, workhrs,
major, active, inclevel, satlevel, and marital. Use scrollbar for Data preview pane
to reach the other columns. Leave the last three variables as generic names.
13. For V13, CHANGE the Characters number to 8!!!
14. Click Next button.
15. Here you could save the import specifications you created in the steps to read other
text data files (you can paste and save the underlying command syntax into a syntax
file that can be edited and saved, also).
16. Click Finish button to read the data into Data Editor.
17. The Data Editor window should contain values 10 through 20 for recnum.
We should now have 3 data files (exercise1.sav, excel.sav, and text.sav). Now we
want to merge the files into one data file.
6. The variables in the files share common names so the pairing is done for you. If not,
you would have to pair the names so the data column (variable) from excel.sav would
correspond with the correct column (variable) in the merged data file.
7. Click on Paste button. Syntax1 will open up with commands in the SPSS Syntax
Editor window. What you have done is create a syntax file, a list of SAX Basic
Language commands that can be saved and rerun later as a “program”.
8. Click on Run from menu, then All.
9. Click GoTo Data button on toolbar. The window should have ten cases in it now.
10. Save the new data file as merged2.sav.
11. With merged2.sav still in Data Editor, let’s merge another file, adding cases.
(Remember how?)
12. Select text.sav this time from file list.
13. Because not all the variable names match, we must pair three from each file. See pg.
52.
14. Pair by holding Ctrl key down and clicking on the two variables, one from each file
in Unpaired Variables list, then clicking Pair button. This will move them to
Variables in New Working Data File.
15. Repeat for the other two variables in each file. All variables should be paired up on
the right side list now. (If the pairing fails for V13 and lastname, you did not change
the characters to 8 during importation of text file. Click on Cancel, then go into
text.sav to change Width for V13 to 8. Resave text.sav, then repeat the merge
attempt.)
16. Click OK button.
17. Save the merged file as merged.sav.
************************************************************************
We have finished SPSS Basic Step 1. Let’s find out something about our dataset.
How? Through the selection of a procedure (remember: this is Step 2 in using
SPSS) . For example, if you want to know the number of males and females in this
sample, you need to see the distribution of the variable gender. You can use the
Frequencies procedure for this.
Now we are at Step 3 in the use of SPSS, the selection of the variables for use in the
Frequencies procedure.
We have reached Step 4. The results of the Frequencies procedure can now be
examined in the Viewer window.
You can select different objects in the Display pane by clicking on the name of the object
in the Outline pane. The Display pane shows you:
• all the respondents indicated their gender (no missing data).
• the breakdown of gender as percentages.
• a bar chart showing a graphic display of frequencies
• the log file of the commands used to create the output (at the top)
Notice the button (the designated window) at the top. This means this output file
is the receiving file of all output generated during this session (as long as it remains
When you are finished exploring the Viewer window, click on GoTo Data button.
You will change to Data Editor window.
***********************************************************************
*
Now we want to split a file to group cases according to a variables’s values. You can
group data on a maximum of 8 variables’ values, in order of selection.
************************************************************************
To export a chart:
1. Double-click on one of bar charts in Display pane. Chart Editor window will open
up.
2. Select File from menu, then select Export Chart.
3. In Export Chart dialog box, select JPEG for File Type.
4. Name file exercise1.
5. Click Save button.
6. Select File, then Close to close out Chart Editor window.
7. Click on minimized SPSS folder on task bar at bottom of screen.
8. Open exercise1.jpeg to view it. Close the file. Return to Viewer window.
To exit SPSS: