Introduction to SPSS
What is SPSS
tatistical Package for the Social Sciences
SPSS has been the most commo
program for quantitative data analysis in the so
It provides a powerf
ul statistical analysis
and data management system.
What is SPSS
SPSS can take data fro
almost any typ
of file and use them to generate tabulated report
d plots of distrib
and trends, descriptive statistics, and complex statistical analysis.
convenient for the experienced user and approachable for the beginner.
etting Started with SPSS
pen a Data File
asic Data File Structure
s and Organization of Data
reating and Editing a Data File
nsert and select Case/Variable
ata Process and Trans
Getting Started with SPSS
After starting Windows, double clicking on the SPSS icon .
Or From the Start menu choose: Programs > SPSS for Windows > SPSS for Windows.
When “SPSS 11.0 for windows”
is first entered
the display will be similar to
Figure 1 below
SPSS is a Windows package. The Data Editor displays the contents of the
orking data file.
Each window has its own toolbar. When you put the mouse
on a tool, a brief description of the tool pops up.
SPSS for Windows is menu driven. Most of the features are
accessed by selections
from the menus. The main menu bar contains 10 menus are similar to other Windows applications, e.g. Microsoft Excel.
To define Toolbars, t
change Fonts, Grid Lines,
odify or copy text from
the output or syntax
To create a new SPS
n an existing file;
or read in spreadsheet or
database files created
by other software program
ke changes t
ected variables in the
data file and to com
pute new variables ba
on the val
es of existing ones. These changes
do not affe
ct the perm
anent file unless you
itly save the changes.
ke global change
s to SPSS data files,
such as m
and cases, or creating subsets of cases for analysis.
To create t
e various graphs, such as bar
charts, pie charts, hist
graphs can be customized with the Chart Editor.
To select the various
you want t
crosstabs, analysis of
and linear regression.
Help window contai
ation on how
to use the m
ny features of SPSS. Context-
available through the
To switch between SPSS windows or to m
ze all open SPSS windows.
ation on the contents of SPSS
data files, define Vari
able Sets, Run Script.
Open a data file
Open a data file
From the Menus, Choose
y, you can use t
e Open File
n on t
bar. The Open File
dialog box will appears.
mat data files (.sav
extension) are displayed. You can di
other file for
ats using t
e Files of Type drop-
The data file will disp
The Data Editor Window
The Data Editor provide
s a convenient,
thod for creating and edit
ing data files. When you start
a session, the Data Edit
or window opens autom
The Data Editor provides
two views of your data:
e actual dat
values or define
Displays variable defini
le and val
labels, data type (for exam
ple, string, date, and
scale), and user-defined missing values.
In both views, you can add, change, and delete inform
ation contained in the da
The Viewer window displays the tables, statistics, and char
automatically the first time you run a command t
Basic Data File Structure
The Data Editor reflects the basic data file structure.Each r
ents a case or an obs
row corresponds to a un
esents a vari
ach cell cont
of a vari
able for a case.
You can enter and edit data in the Data Editor and use many different data types, i.e. Numeric, String (alphanumeric), Date, Dollar (currency). However, you can
enter formulas or perform calculations in the Data Editor. Please use the Transform menu to calculate new values and variables and recode data.
s and Organization of Data
A sample survey of
Suppose we have a data set. There are 10 sample rows of the data
Design a Coding Scheme
ng scheme i
a way t
with a questionnaire
response. The codes are what you enter into a data file. Codi
chemes are arbi
example, for nomi
riables, either coding
way is acceptable for SPSS.
on 4 (i
you can defi
as two strings value
(i.e. f=female, m=male).
on 3 (i
Income per month) in
sample questionnaire, you can define the “
as four numeric va
lue (i.e. 1=below
on 2 (i
cation Level) in sample
questionnaire, you can define the
as four numeric valu
e (i.e. 1=Diploma,
2=Bachelor, 3=Master, 4=Others)
Creating and Editing a Data File
ll and enter
data value appears in the cell and in the cell editor.2. Press Enter to record the value. If
named the variable, The Data Editor
assigns a unique variable name.
1. To enter non-numeric
data, you need to define
the variable.2. Doubl
e-click on the var
able name at t
e top of
the column. Or click the
Variable View tab. The
Variable View appears as bel
3. Click the Type cell in the row for the variable, and then click the button in the cell.
4. Select the data type in the Define "Variable Type" dialog box. For example, to enter data values that contain letters, select String.5. Then click OK
In addition to defining
data type, you can also
define descriptive variable and value labels for data values.
A. Variable Names
The following rules apply to valid Variable Names:?
he name must begin with a letter.
ariable names cannot end with a period
he length of the name cannot exceed eight
ariable names must be unique; duplication is
lank & Special characters cannot be used.
B. Variable Label
To define a variable label
, click the Label cell
in the row for the variable and then enter thedescriptive label. Give more detail description but not over 120 charac
ters. These labels are
used in statistical
reports and charts.
uestion 1 -
ou can type "Age" in the
Label cell in the row 1.
uestion 2 -
ou can type "Education" in
the Label cell in the row 2.
uestion 3 -
ou can type "Income per
month" in the Label cell in the row 3.
uestion 4 -
ou can type "Gender" in the
Label cell in the row 4.
C. Values Label
1. To define a values label, click the Values cell in the row for the variable, and then click button in the cell.
2. When the "Value Labels" dialog box appears, enter the data value and the descriptive label.
3. For example, In question 2 in sample questionnaire, you can define the "Education" as four numeric values.1=Diploma 2=Bachelor
3=Master's degree 4=Others
4. Click on Add to record the value label for the each data value, and then click on OK when you are finished.
D. Missing Value
In SPSS, there are two types of missing
System-missing values and User-missing values.
Any blank numeric cells are assigned the system-
missing value, which is indicated with a period(.).
You can assign values that identify information
missing for specific reasons and then instruct SPSS to flag these valu
es as missing.
ing Values for a Variable
1. Make the Data Editor the active window.2. If the Data view is displayed, double-click the variable name at th
e top of the column in
the Data view or click the Variable View tab.
3. Click the button in the "M
issing" cell for the v
which you want to define.4. When the "Missing Values"
dialog box appears, select
"Discrete missing values" a
nd enter the values that
ssing data. (or se
lect the "Range pl
e" and en
ter the range of
values that represent missing data.)
Insert and select Case/Variable
A. To Insert a New case
between Existing Cases
1. Select any cell in the case (row) below the position where you want to insert the new case.2. From the menus bar choose Data
B. To Insert a New
1. Select any cell in the variable (column) to the right of the position where
you want to insert
the new variable.2. From the menus bar choo
C. Select the cases
rict your a
group (e.g. only female, only Master's degree, etc..)
1. From the menus choose Data > Select Case. The "Select Case" dialog box as shown below.
2. Check the "If condition is satisfied" ratio button and click on "If .."
button. The "Select
Cases If" dialog as shown below.
3. In this sample, enter the conditional expression (over 25 year old). Select "Age[age]" and click on button.
4. For example, type '> 25'.You can use the calculator pad, variable list, and function list to paste these elements into the expression.
5. Click "Continue" button.
If you have selected a case but have not discarded unselected cases, unselected cases are marked in the Data Editor with a diagonal line through the row number.
Assume you have Excel file as like as below
To Convert Excel file:?
. From the menu, choose File > Open >
Data, then the 'File Open' dialog box appears.
l from 'files of type'. An
then select the drive and the directory in which your Excel file is located.
3. The 'Opening File Options' dialog box appears, check 'Read variable names' and type "A1:E11" in the Range.
5. After the data are converted, it will appear in a spreadsheet-link windows titled untitled. Check all cases a
been read into the data set.
4. Click OK button. And then minimize the Output1 window.
Now, you can define data?
n the "Variable Type" dial
og box, set the appropriat
format, number of decimal
places, column width, and
n the Labels cel
, type in a descri
tive label for the
e. e.g. type in Eudcation
Level for the educ
you can define the "Educat
. Click on the Data View wor
sheet to check the data set.
. From t
ile > Save. Mar
have select SPSS for your file
type (SPSS system file), the
SAV extension added to your
ow, if you quit SPSS program, you
having to read in the Excel
spreadsheet and define the
analysis categories and a list of general reporting. Most of the categories are followed by an arrow. There are several analysis procedures available within the category. When the category is picked, they will appear on a submenu.
u must d
between two types of variables: continuous and discreet. The continuous variables can take any real number value, including fractional values, e.g. age and income. The discreet variables can only take one
l integer value
are used to represent the categorical information: e.g. education level.
A. Summary information
about continuous Variables
1. From the menu, choose Analyze > Descriptive Statistics > Descriptives..., the dialog box appears as shown below.
. Select a variable (e.g., select 'Age' and
'Income' variables.) and then click on button.
. Click on the Options button, you can
select the following options: Mean, Std deviation, Minimum, Maximum, etc...) in the resulting dialog box.
. Click on the Continue button to close
the dialog box.
5. In the "Descriptives
" dialog box, click on
the OK button. The Output window appears as shown the results below.
B. Summary information
about Discrete Variables
st popular of u
ing SPSS is
creating frequency table. The frequencies procedure produces frequency table, measures of central tendency and dispersion, bar charts and histograms. you can sort frequency tables by count or by value. In this example, you can also use this to generate a
graphic summary of
1. From the menu, choose Analyze > Descriptive Statistics
> Frequencies..., the
dialog box appears as shown below.
. Select a variable (e.g., select 'educ'
variables.) and then click on button.
. Click on the Statistics button.
. In the "Frequencies: Statistics" dialog
box, choose Median and Mode in the Central tendency group, and choose Minimum and Maximum in the Dispersion group. Click on the Continue button.
5. Click on the Charts button. In the "Frequencies: Charts" dialog box, choose Histogra
6. Click on the Continue button.
7. When you return to the "Frequencies" dialog box, click on the OK button. Results are displayed in the viewer
window. You can go to any item in the Viewe
selecting it in the outline pane.
Data Process and Transformation
or example, create a Variable named
Bonus and base on 15% of the income.
1. To compute values for a variable based on numeric transformations of other variables, from the menus choose Transform > Compute. The Compute dialog box appears as below.
2. In the Compute dialog box, give "Target variable" (like you define variable), you can type "Bonus" into the Target Variable. And also you can click on the "Type & Label" button, give more description for the "Target Variable".
3. Select the data type (this is required for
nd then Click on
4. When return to the "Compute Variable"
dialog box, select and then click on button.
5. Type '* .15' in the "Numeric
6. Click OK button.
We will also look at details
afterwards on many other
functions and tools in SPSS
when having this course