INTRODUCTION
This document contains a series of four modules intended for SPSS users. The first module
introduces readers to the SPSS for Windows environment while the second module discusses
graphical display of output. The third module describes data manipulation techniques and the
fourth module describes some commonly used inferential statistics. These set of documents
use a sample dataset, Employee [Link], that SPSS provides.
MODULE I
This document is the first of a series of four modules intended for beginning SPSS users,
providing an overview of SPSS for Windows. This first module introduces readers to the
SPSS for Windows environment, and discusses how to create or import a dataset, transform
variables, manipulate data, and perform descriptive statistics.
Section 1: Overview
Overview of SPSS for Windows
This document discusses the two windows most frequently used in analyzing data in SPSS,
the Data Editor and the Output Viewer windows.
• The Data Editor is the window that is open at start-up and is used to enter and store
data in a spreadsheet format.
• The Output Viewer opens automatically when you execute an analysis or create a
graph using a dialog box to execute a procedure. The Output Viewer contains the
results of all statistical analyses and graphical displays of data.
Section 2: Entering Data in SPSS
The Data Editor
The Data Editor window displays the contents of the working dataset. It is arranged in a
spreadsheet format that contains variables in columns and cases in rows. There are two sheets
in the window.
• The Data View is the sheet that is visible when you first open the Data Editor and
contains the data.
• You can access the second sheet by clicking on the tab labeled Variable View. This
second sheet contains information about the variable that is stored with the dataset.
The Data Editor contains several menu items that are useful for performing various operations
on your data. Here is the Data Editor containing the Employee [Link] dataset:
1
Data can be directly entered into SPSS, or a file containing data can be opened in the Data
Editor. From the menu in the Data Editor window, choose the following menu options:
File
Open...
Data can be imported into SPSS from Microsoft Excel and several other applications with
relative ease. For example, if data is in Microsoft Excel format, you can simply copy and
paste it into the Data View sheet of the Data Editor window.
The Output Viewer
All output from statistical analyses is printed to the Output Viewer window. When you
execute a command for a statistical analysis, the output will be printed in the Output Viewer.
The Output Viewer is shown below:
By clicking on an icon on the left frame you can move to the location of the output
represented by that icon in the Output Viewer. You can also copy, paste, or delete objects by
first highlighting them in the outline and then performing the operation you want.
Section 3: Creating and Modifying Data in SPSS
Creating and Defining Variables
After data are in the Data Editor window, there are several things that you may want to do to
describe your data.
Definition:
• A variable is a measure or classification scheme that can have several values.
• Values are the numbers or categorical classification representing individual instances
of the variable being measured.
For example, a variable could be created for job classification status. Each individual in the
dataset would be assigned a value representing their job classification. For instance, we could
assign custodians the value 1, clerks the value 2, and managers the value 3.
One reason to define information about your variables is to help you interpret the output. For
example, if you have a variable representing employment categories that is coded as either 1,
2, or 3 for employment categories clerical, custodial and managerial, respectively, it may be
2
tiresome to remember which number represents which category in the output. One advantage
of defining variables is that these values can be assigned labels that will appear in your
output, thus making it much easier to interpret.
You can define information about your variables by clicking the Variable View tab. Doing so
will bring the variable information sheet to the foreground (you will see a spreadsheet
organized as the one below):
Many of the cells in the spreadsheet contain hidden dialog boxes that can be activated by
clicking on a cell. If you see a gray box appear on the right side of the cell when you first
click on the cell, this indicates that there is a hidden dialog box which can be accessed by
clicking on that box. For example, clicking on the box in the cell for the Type column for the
variable jobcat produces the following dialog box:
This box allows you to define the type of data for variables. For example, you will be
presented with Numeric, String, and Date options among others. Thus, if you want to define
the variable jobcat (which represents employment category) as a string variable (a variable
whose recorded values are words instead of numbers), first click on the cell in the Type
column on the jobcat row and then click the gray box to produce the Variable Type dialog
box. Here, you would choose the String option.
The Missing Values column allows you to define which values of a variable should be treated
as missing data. The Label column is used to define labels for variables. The Values column is
3
used to assign labels to the particular values of a variable. For example, the following dialog
box shows a variable that has been assigned the values 1, 2, and 3 for the labels Clerical,
Custodial, and Manager, respectively.
To define variables as shown above, you should first enter the value (e.g., 1) in the box
labeled Value, then enter the label associated with that value (e.g., Clerical), and click on the
Add button. Repeat this process for each value you want to label.
Computing New Variables
You may want to create new variables in your datasets. For example, if a dataset contained
employees' salaries in terms of their beginning and current salaries, a new variable (say,
difference between starting salary and present salary) could be computed by subtracting the
starting salary from the present salary. Such operations can be performed using the Compute
option available from the menu in the Data Editor:
Transform
Compute...
This will result in the following dialog box:
To create a new variable, type its name in the box labeled Target Variable. The expression
defining the variable being computed will appear in the box labeled Numeric Expression. This
expression can either be typed into the box directly, or you can use the buttons located below
the Numeric Expression box to input values or operators. The example shown above
demonstrates the computation of a new variable. This new variable, salchng, will be the
4
difference between an employee's current salary and beginning salary. The new variable will
appear in the rightmost column of the working dataset.
Variables can also be computed conditionally. For instance, if, in the above example, you
were only interested in the change in salaries for people who began working for the company
within the last five years, you could create a condition that would compute a new variable
only if an employee had begun employment within the last five years. To do this, first click
on the button labeled If, which will produce the following dialog box:
First, click on the button labeled, Include if case satisfies condition to activate the gray areas
of the dialog box. Then, specify the condition for computing a new variable in the input box
at the top right of this dialog box. The above example illustrates the definition of a condition
that requires cases of jobtime (which represents the number of months since an employee has
been hired) to have less than five years (60 months) in order to be included in the computation
of the new variable. Click the Continue button to return to the previous dialog box.
Recoding Variables
You can also modify the values of existing variables in your dataset. For example, if a dataset
contains a variable that classifies an employee's status in three categories, but for a particular
analysis you want to combine two of these classifications into a single category, then two of
the values would need to be recoded into a single value so that there are only two groups. The
Recode option is available from the menu in the Data Editor:
Transform
Recode
Additionally, there are two options for recoding variables in the Recode submenu. The Into
Same Variables option changes the values of the existing variables, whereas the Into Different
Variables option is used to create a new variable with the recoded values. Both options are
essentially the same, except that recoding into a different variable requires you to supply a
new variable name.
The following example illustrates the use of the Recode option to recode values into a new
variable. When that option is selected from the menu, the following dialog box will appear:
5
First, a variable from the existing dataset should be selected by clicking on that variable, then
clicking the arrow button in the middle of the dialog box. This will result in the selected
variable being displayed in the box labeled, Numeric Variable -> Output Variable. Next, you
must supply the name of the new variable, and optionally you can supply a label for the new
variable. After a new variable name has been supplied, click on the button labeled Old and
new Values. This will result in the following dialog box:
The above dialog box is the same regardless of whether you are recoding values into the same
variable or creating a new variable. The original value of the variable being recoded is entered
in the box labeled Old Value, and the new value is entered in the box labeled New Value.
After values are entered in these boxes, click on the button labeled Add to complete the
recode process.
In the example dataset, jobcat has three values: 1, 2 and 3. If the goal were to combine cases
with the values 2 and 3, this could be accomplished by recoding cases with the value 3 into
2's. For example, by entering 3 in the box labeled Old Value and entering 2 in the box labeled
New Value then clicking Add, all of the cases labeled 3 would take on the value 2. This can
be repeated for as many of the values as necessary.
Values can also be recoded conditionally. The process for recoding values on the basis of a
condition is essentially identical to the process for conditionally computing new variables
discussed in the previous section: when you click on the If button in the main Recode dialog
box, the same dialog box that was obtained from clicking If in the Compute dialog box will
appear with the same options.
6
Sorting Cases
Sorting cases allows you to organize rows of data in ascending or descending order on the
basis of one or more variable. For example, data could be sorted by job category so that all of
the cases coded as job category 1 appear first in the dataset, followed by all of the cases that
are labeled 2 and 3 respectively. The data could also be sorted by more than one variable. For
example, within job category, cases could be listed in order of their salary. The Sort Cases
option is available under the Data menu item in the Data Editor:
Data
Sort Cases...
The dialog box that results from selecting Sort Cases presents only a few options:
To choose whether the data are sorted in ascending or descending order, select the appropriate
button. You must also specify on which variables the data are to be sorted. The hierarchy of
such a sorting is determined by the order in which variables are entered in the Sort by box.
Variables are sorted by the first variable entered, then the next variable is sorted within that
first variable. For example, if jobcat was the first variable entered, followed by salary, the
data would first be sorted by jobcat, then, within each of the job categories, data would be
sorted by salary.
Selecting Cases
You can analyze a specific subset of your data by selecting only certain cases in which you
are interested. For example, you may want to do a particular analysis on employees only if the
employees have been with the company for greater than six years. This can be done by using
the Select Cases menu option, which will either temporarily or permanently remove cases you
didn't want from the dataset. The Select Cases option is available under the Data menu item:
Data
Select Cases...
Selecting this menu item will produce the following dialog box. This box contains a list of the
variables in the active data file on the left and several options for selecting cases on the right.
7
Selecting one of these options will produce a second dialog box that prompts you for the
particular specifications in which you are interested. For example, selecting the If condition is
satisfied option and clicking on the If button (as was done in the example) results in a second
dialog box, as shown below. The portion of the dialog box labeled Unselected Cases Are
gives you the option of temporarily or permanently removing data from the dataset. The
Filtered option will remove data from subsequent analyses until the All Cases option is reset.
If the Deleted option is selected, the unselected cases will be removed from the working
dataset (data will be lost forever if the file is saved).
The above example selects all employees that have worked at the company for greater than
six years (72 months). After this selection has been made, subsequent analyses will use only
this subset of the data. If you have chosen the Filter option in the previous dialog box, SPSS
will indicate the inactive cases in the Data Editor by placing a slash over the row number. To
select the entire dataset again, return to the Select Cases dialog box and select the All Cases
option.