Upload
others
View
34
Download
0
Embed Size (px)
Citation preview
Centre for Learning and Academic Development (CLAD) Technology Skills Development Team
Course Code: SPSS19
Introduction to IBM SPSS Statistics
www.intranet.birmingham.ac.uk/itskills
An Introduction to IBM SPSS Statistics
Author: Sonia Lee Cooke
Acknowledgement: Thanks to Dr. Sayeed Haque for his valuable
contributions throughout the development of this course.
Version: 1.0, January 2012
© 2010 The University of Birmingham
All rights reserved; no part of this publication may be photocopied, recorded or otherwise reproduced, stored in a retrieval system or transmitted in any form by any electrical or mechanical means without permission of the copyright holder.
Trademarks: Microsoft Windows is a registered trademark of Microsoft Corporation. All brand names and product names used in this handbook are trademarks, registered trademarks, or trade names of their respective holders.
An Introduction to IBM SPSS Statistics 19 Page 1
Contents Page No.
ABOUT THE WORKBOOK ...................................................................................................................... 1
INTRODUCTION ................................................................................................................................... 3
WHAT IS IBM SPSS STATISTICS ..................................................................................................................... 3
PREPARING DATA FOR ANALYSIS ......................................................................................................... 3
SAMPLE QUESTIONNAIRE .............................................................................................................................. 3 CODING ..................................................................................................................................................... 4
STARTING IBM SPSS STATISTICS 19 ...................................................................................................... 5
THE IBM SPSS STATISTICS DATA EDITOR WINDOW ........................................................................................... 7
THE MAIN MENU AND TOOLBAR ......................................................................................................... 8
THE FILE MENU ........................................................................................................................................... 8 THE EDIT MENU .......................................................................................................................................... 9 THE VIEW MENU ......................................................................................................................................... 9 THE DATA MENU ....................................................................................................................................... 10 THE TRANSFORM MENU ............................................................................................................................. 10 THE ANALYZE MENU .................................................................................................................................. 11 THE GRAPHS MENU ................................................................................................................................... 11 THE UTILITIES MENU .................................................................................................................................. 12 THE ADD-ONS MENU ................................................................................................................................. 12 THE WINDOW MENU ................................................................................................................................. 13 THE HELP MENU ....................................................................................................................................... 13 THE TOOLBAR ........................................................................................................................................... 14
INPUTTING DATA ............................................................................................................................... 16
WORKING IN VARIABLE VIEW ...................................................................................................................... 16 Defining Variable names .................................................................................................................. 16
WORKING IN DATA VIEW ............................................................................................................................ 22 EDITING VALUES AND VARIABLE NAMES ........................................................................................................ 22 INSERTING CASES AND VARIABLES ................................................................................................................. 22 DELETING CASES AND VARIABLE NAMES ........................................................................................................ 23 SPLITTER CONTROL .................................................................................................................................... 23
SAVING A DATA FILE .......................................................................................................................... 24
OPENING A DATA FILE ....................................................................................................................... 24
RUNNING AN ANALYSIS ..................................................................................................................... 24
SELECTING CASES ...................................................................................................................................... 25 CREATING A FREQUENCY TABLE .................................................................................................................... 28 IBM SPSS STATISTICS VIEWER .................................................................................................................... 29
Working with SPSS Output ............................................................................................................... 29 SPLIT FILE ................................................................................................................................................. 29 CREATING A DESCRIPTIVES TABLE .................................................................................................................. 31 RECODING ............................................................................................................................................... 32 CROSS TABULATION ................................................................................................................................... 34 COMPUTE FUNCTION .................................................................................................................................. 35
CREATING CHARTS ............................................................................................................................. 36
LEGACY DIALOGS ....................................................................................................................................... 36 CHART BUILDER ........................................................................................................................................ 38 EDITING CHARTS ........................................................................................................................................ 41
Changing the chart colour ................................................................................................................ 42 Change the Y-axis scale .................................................................................................................... 42 Change the title ................................................................................................................................ 42 Displaying data value labels ............................................................................................................. 42
A STUDY OF THE WONDERFUL PEOPLE WHO COME ON RESEARCH SKILLS TRAINING COURSES IN THE WEST MIDLANDS . 3
An Introduction to IBM SPSS Statistics 19 Page 1
About the workbook The workbook is designed as a reference for you to use after the course
has finished. The workbook is yours to take away with you so feel free
to make any notes you need in the workbook itself.
The workbook is divided into sections with each section explaining
about a particular feature of the program or how to do a particular task.
Sections that take you through a particular procedure step-by-step look
like this:
How to do something
Do this first.
Then do this.
Then do this to finish.
There are also a number of text boxes to watch out for throughout the
workbook. These will help you to get the most out of the course.
Tip
The thumbs-up symbol in the margin indicates a tip. These tips will help you
work more effectively.
Danger!
The thumbs-down picture in the margin indicates common mistakes or
pitfalls to be avoided.
An Introduction to IBM SPSS Statistics 19 Page 3
Introduction
Quantitative research can involve processing data which can be
collected in many different ways depending on the nature of your
research; it could come from responses from questionnaires,
information collected from interviews, or experiment. SPSS provides a
wide range of capabilities that will help you to manage the wealth of
information.
What is IBM SPSS Statistics
SPSS is a statistical software package which runs under windows and
the Apple Macintosh. It is designed for managing and analyzing
quantitative data. During the 1960s SPSS initially stood for Statistical
Package for the Social Sciences. In 2009 it was re-branded as PASW
(Predictive Analytics SoftWare), and now it is known as IBM SPSS
Statistics 19.
The University of Birmingham have been using SPSS for over 30 years.
It is in great demand by users and far more popular than all the other
statistical packages.
This document was written to accompany the IBM SPSS Statistic
course (An Introduction to IBM SPSS Statistics 19). This course is
intended for those who are new to SPSS and with the aid of a sample
questionnaire; this course provides an overview of the basic features of
SPSS.
Preparing data for analysis
Sample questionnaire
Page 4 An Introduction to IBM SPSS Statistics 19
There are a number of procedures that needs to be carried out before
you can use SPSS such as understanding how SPSS works; preparing
data in order to enter it into SPSS and translate the data you have into a
format suitable for SPSS. You should also have a good idea of how you
are going to analyse the data before you start to collect it, if not, this
may lead to difficulties when you come to analyze your data.
Coding
SPSS can only analyse numbers. Therefore, you need to code your non-
numeric data into numbers.
We used the above questionnaire to collect data about people who came on the Research Skills Training courses in
the West Midlands. The following two questions were taken from the questionnaire:
1. How satisfied are you with your job were measured as:
very satisfied, fairly satisfied, no opinion, a little dissatisfied
and very dissatisfied
2. We also collected data on peoples’ gender
A numerical code must be assigned to each response before the data is
entered into SPSS as shown below:
Gender:
Male = 1, Female = 2
Or
Male = 2, Female = 1
How satisfied are you with your job:
very satisfied = 1 fairly satisfied = 2 no opinion = 3 a little dissatisfied = 4 very dissatisfied = 5
Or
very dissatisfied = 1 a little dissatisfied = 2 no opinion = 3 fairly satisfied = 4 very satisfied = 5
An Introduction to IBM SPSS Statistics 19 Page 5
Starting IBM SPSS Statistics 19
To start SPSS do one of the following:
From one of the computers in a cluster on campus, click on the
Start button at the bottom left of the screen
Click on All Programs, click on [ITS Applications], click on IBM SPSS Statistics, IBM SPSS Statistics 19.
Click on the Start button, select Programs, IBM SPSS Statistics 19.
If you have an IBM SPSS Statistics 19 icon on the desktop double click on it.
The IBM Statistics 19 dialogue box appears:
Under ‘What would you like to do?’ You can choose from six
options by clicking on one of the radio buttons to select the
required option.
You can run the tutorial, type in data, open an existing data
source or open another type of file from different software.
By default the Open an existing data source is selected:
To create a new data file, select Type in data and click on the
OK button at the bottom of the IBM SPSS Statistics 19 dialogue
box.
Page 6 An Introduction to IBM SPSS Statistics 19
This automatically opens the IBM SPSS Statistics Data Editor
window.
At the top of the window are the following items:
Title bar
Menu bar
Toolbar
At the bottom of the window are:
The Data View tab
The Variable View tab
The Status bar
An Introduction to IBM SPSS Statistics 19 Page 7
The IBM SPSS Statistics Data Editor window
The IBM SPSS Statistics Data Editor window looks like a
spreadsheet. However, it does not work like one; you cannot enter
formulas into the cells. It is for creating and editing SPSS data files.
The diagram below shows the Data View window.
Rows represent cases or observations
Cells
Toolbar – to access the most frequently used functions
Menu bar – majority of SPSS procedures can be accessed by making selections from the menus
Title bar – displays Untitled1 [DataSet0] – IBM SPSS Statistics Data Editor and when you open another new data file, the title will change to [DataSet1] etc… until you save the data file. The untitled label is replaced by the file name
Close window Maximise window Minimise window
Variable names. Columns represent variables
Status bar – displays information on procedures that you run, each box to the right of ‘IBM SPSS Statistics Processor is ready’ will display a different message depending on what you are working with
Data View is currently active; this view is used to enter data or view information already created
Variable View - this view is used to create the names and details of the variable in your data set
Page 8 An Introduction to IBM SPSS Statistics 19
The Main menu and Toolbar
The vast majority of IBM SPSS Statistics functions can be accessed
through the menus. There are 11 drop-down menus which are located at
the top of the IBM SPSS Statistics window; details of the menus are
listed below, together with information on the most commonly used
functions on the toolbar.
The File menu
The File menu allows you to create a new IBM SPSS Statistics data file,
open an existing data file, save a data file, and import a database from
MS Access or Read Text Data… from an MS Excel workbook and other
functions listed on the drop-down menu.
An Introduction to IBM SPSS Statistics 19 Page 9
The Edit menu
You can use the Edit menu to modify the data file and change the
general default options for various functions such as charts, data view
and viewer.
The View menu
The View menu allows you to view or hide different type of items such
as the Status bar at the bottom on the screen, toolbars, change fonts,
hide or show grid lines, value labels to change the view from text to
numeric values and switch between variables and data views.
Page 10 An Introduction to IBM SPSS Statistics 19
The Data menu
The Data menu displays a list of various options such as sort cases, split
file and select cases. See pages 24 to 30 for more details on select cases
and split file.
The Transform menu
The Transform menu displays a list of various options such as calculate
variable and recode new variable based on the values of existing ones.
See page 32 and 36 for more details on recode into different variables
and compute variable.
An Introduction to IBM SPSS Statistics 19 Page 11
The Analyze menu
The Analyze menu displays a list of various statistical procedures; this
course will only cover some of the Descriptive Statistics functions such
as frequencies, descriptives and crosstabs. See Page 28, 34 and 35 for
more details.
The Graphs menu
The Graphs menu allows you to create various different types of charts
such as bar chart, pie charts, boxplot, histogram scatterplot and others.
See Page 36 for more details.
Page 12 An Introduction to IBM SPSS Statistics 19
The Utilities menu
The Utilities menu allows you to view variables definition information,
add and display descriptive comments to a data file, spell check your
data and various other functions.
The Add-ons menu
You can use this menu to download a chapter sample of the Statistics
guides and various Add-ons functions.
An Introduction to IBM SPSS Statistics 19 Page 13
The Window menu
The Window menu allows you to split the screen into two or more
sections in order to view a wide data set. (See page 23 for more details)
A list of currently used data files is also displayed.
The Help menu
You can use the help Topics on the Help menu to learn about specific
tasks, Statistics Coach provide a wide range of quick step-by-step
instructions that guide you through the process of many of the basic,
commonly used statistical techniques and for detailed examples of
various statistical analysis techniques use Case Studies.
Page 14 An Introduction to IBM SPSS Statistics 19
The Toolbar
Open
Open an existing Data file
Save
Save a data file.
Print a data file.
Recall Recently used Dialogs
Displays a list of recently used dialogue boxes,
which you can access.
Undo Redo
Undo and Redo.
Go to Case
Displays the Go To dialogue box which allows you to
go to any case (row) within the data. Enter the case
number in the text box and click on the Go button
Go to Variable
Displays the Go To dialogue box which allows you to
go to any variable (column) within the data. Click on
the arrowhead to view the list of variable names, select
the variable name and click on the Go button.
An Introduction to IBM SPSS Statistics 19 Page 15
Variables
Provides information on each of the variables in
the data set.
Find
In Data view you can find and/or replace the data value
only in a single column of the data set. Click on the first
cell of the column that contains the data you want to
fine, then click on the Find button.
Note: You can only search in the Down direction in
Data view.
Insert Cases
In Data View, click on the Insert Cases button to insert
new case(s) above the cursor’s position (a case is a
row)
Insert Variables
In Variable View, click on the Insert Variables
button to insert a new variable above the cursor’s
position. In Data view, the new variable is
inserted to the left of the cursor’s position (a
variable is a column)
Split File
Split file allows you to split the data file into
separate groups for analysis.
Weight Cases
Weight Cases – indicate the number of
observations represented by single cases in your
data file, can be used for Chi-square on
summarized data.
Select Cases
Select Cases allows you to perform an analysis
on a subset of cases.
Value Labels
Value Labels allows you to view the labels or
numeric values in your data set.
Page 16 An Introduction to IBM SPSS Statistics 19
Use Variables Set
The list of available variable sets includes any
variable sets defined for the active dataset, plus
two built-in sets: All Variables and New Variables
(shown below).
ALLVARIABLES. This set contains all variables in
the data file, including new variables created
during a session.
NEW VARIABLES. This set contains only new
variables created during the session. You cannot
add a new variable to the dataset unless you have
the NEW VARIABLES selected.
Spell Check
Check for misspelled items in Data View, Variable
View and Value labels
Inputting Data
The SPSS Statistics Data Editor window has two views which are located at the bottom of the window:
Variable view - when you are entering data for the first time, you
must use this view to define the variable names.
Data view – use this view for entering, editing and displaying
data, after you have defined the variable names.
Working in Variable View
To define variable names, ensure you are in the variable view. You
must create the variables in this view before entering the data.
Defining Variable names
To define the names and details of each variable in your data set:
Click on the Variable view tab (if it’s not active)
An Introduction to IBM SPSS Statistics 19 Page 17
Tip:
You can also double-click on any one the variable names (column heading
in the Data view window) to switch to the Variable View window. Or press
Ctrl T to toggle from Variable View to Data View.
The Variable view window appears:
There are pre-defined attributes at the top of each column. You
can use these attributes to define the variables and insert a
description for each variable in your data set.
Variable names are entered in rows and the variable attribute in
the columns.
The first variable in a data set must be ID (a unique number that
identifies each case). See below for information on each
variable:
Your Variable names should be short and
meaningful. Each variable must have a
different name. If no name is entered SPSS
will use the default name (VAR0001, VAR0002
etc…) for each variable. You can have up to
64 characters, however, variable name that
exceeds eight characters are not displayed in
the variable list, and you may have to resize
the column. No spaces are allowed in each
variable.
If you enter characters that are not allowed,
such as * - / !, the following dialogue box will
appear:
The name must start with a letter, names can
contain the following characters:
_ (underscore), $, #, and @.
Page 18 An Introduction to IBM SPSS Statistics 19
To define the type of variable, click in the cell
below the Type heading.
Click on the grey button with three dots to
display the Variable Type dialogue box:
The default variable type is Numeric, the standard default width is eight characters, and cannot exceed 40 characters. The decimal places are two characters, and cannot exceed 16 characters. If you change the values of the Width and Decimal Places within the Variable Type dialogue box it will also reflect in
the Width and Decimals cells (listed below).
Comma, Dot, Scientific notation, Dollar and Custom currency are
not commonly used.
Dates are listed in several different formats and can be entered with slashes, hyphens, full-stops, commas, or blank spaces as delimiters:
An Introduction to IBM SPSS Statistics 19 Page 19
Select a date format from the list, e.g. if you select dd-mmm-yyyy the current date will be displayed in the following format style: 21-Jan-2012.
Select the required option. Numeric and String are the most
commonly used options. String is for recording names or other
text, you cannot exceed 32,767 characters.
String should only be used if it’s absolutely necessary.
Click OK to return to the Variable view.
You can enter up to 40 characters for the
width.
Click on the spinner (arrow up/down) to
increase or decrease the width.
You can have from 0 to 16 decimals places.
Click on the spinner (arrowhead up/down) to
increase or decrease the decimals places.
You can assign descriptive variable labels
that can contain spaces and special characters
that are not allowed in the variable name.
You can have over 255 characters.
You can define values by selecting the cell below the heading.
Click on the grey button with the three dots to display the Value Labels dialogue box:
Enter the number in the Value text box – eg,
let say you have coded, 1 = Male and
2 = Female.
Enter 1 in the Value text box.
Enter Male in the Label text box. (You can
enter up to 120 characters).
Page 20 An Introduction to IBM SPSS Statistics 19
Click on the Add button. Repeat above
instructions until you have entered all the
values. Click on the OK button.
You might want to distinguish between data
that are missing because a respondent
refused to answer a question or the question
didn't apply to that respondent. Data values
that are specified as user-missing are flagged
for special treatment and are excluded from
most calculations.
To declare the codes that you use for your
data. Click on the grey button with three dots
below the heading (Missing) to display the
Missing Values dialogue box:
Select Discrete missing values.
You can enter up to three discrete (individual)
missing values codes, or a range plus one
optional discrete missing value.
Ranges can be specified only for numeric
variables.
You cannot define missing values for long text
variables that are longer than eight characters.
Enter the missing number in the text. Ensure
that the number you enter is not valid in your
data set.
You cannot exceed 255 characters.
Click on the spinner (arrowhead up/down) to
increase or decrease the numbers.
An Introduction to IBM SPSS Statistics 19 Page 21
Click on the arrowhead to display a drop-
down list.
Select the required alignment. The default is
right for numeric values and left for string
values. The alignment only displays in the
Data View.
You can choose from three different levels of
measurements.
Click on the arrowhead to display a drop-
down list.
Select the required option.
Some dialogs support predefined roles that can be
used to pre-select variables for analysis. When you
open one of these dialogs, variables that meet the
role requirements will be automatically displayed
in the destination list(s). Available roles are:
Input. The variable will be used as an input
(e.g., predictor, independent variable).
Target. The variable will be used as an output
or target (e.g., dependent variable).
Both. The variable will be used as both input
and output.
None. The variable has no role assignment.
Partition. The variable will be used to partition
the data into separate samples for training,
testing, and validation.
Split. Included for round-trip compatibility with
IBM SPSS Statistics Modeler. Variables with
this role are not used as split-file variables in
IBM SPSS Statistics.
By default, all variables are assigned the Input
role. This includes data from external file
formats and data files from versions of SPSS
Statistics prior to version 18.
Role assignment only affects dialogs that
support role assignment. It has no effect on
command syntax.
(This information on Role was taken from the
IBM SPSS Statistics help topics)
Page 22 An Introduction to IBM SPSS Statistics 19
Working in Data View
The Data view is used to enter data after you have defined the variable
names in the Variable View window.
In Data view if you place the mouse pointer over one of the variable
names (column heading), a more descriptive variable label is displayed
(only if you have defined a label for that variable, see section above –
Defining Variable names).
By default, the actual data values are displayed in the cells. To make it
easier to interpret the responses, you can switch the view.
To switch the view from values to labels:
Click on the View menu, select Value Labels, alternatively,
Click on the Value Labels button on the toolbar.
Editing Values and Variable Names
To edit a value or variable name in the Data view:
Double-click in the cell that contains the value or variable name.
Type the relevant information.
Press Enter (or move the cursor to another cell) to display the
new value.
Inserting Cases and Variables
To insert cases (rows) in data view window:
Place the cursor where you want to insert the case(s):
Click on the Edit menu, select Insert Cases, alternatively,
Click on the Insert Cases button on the toolbar.
To insert variable name(s) in the variable view window:
Place the cursor where you want to insert the variable name(s):
An Introduction to IBM SPSS Statistics 19 Page 23
Click on the Edit menu, select Insert Variables, alternatively,
Click on the Insert Variables button on the toolbar.
Deleting Cases and Variable Names
To delete cases in the data view window:
Click on the row number on the left of the case you want to
delete, to highlight the entire row.
Click on the Edit menu, select Clear to delete the entire row.
To delete variable name and content in the variable view window:
Click on the column heading to highlight the entire column that
contains the variable you want to delete
Click on the Edit menu, select Clear to delete the entire column.
Splitter control
The splitter control is a quick and easy way to manage data sets that are
very wide and long. You can split the window vertically and
horizontally into two panes and control each pane separately. It is also
useful for copying and moving data between parts of a long data set.
To set the splitter control:
Click on the Window menu, select Split.
The horizontal and vertical splitter bars appears on the screen:
You can change the position of the vertical or horizontal bar, e.g. if you place the cursor on the horizontal bar the cursor changes to
Page 24 An Introduction to IBM SPSS Statistics 19
a drag it to the position you want. If you only want to use one bar, double click on the one you don’t want to use to hide it.
Notice when you use the scroll bar to scroll through the data you
can view two parts of your data set simultaneously.
To remove the split, click on the Window menu, select Remove
Split.
Saving a Data File
To save a data file:
Click on the File menu and select one of the save options:
Save - if you select this option and the file has no name, the
Save Data As dialogue box appears, enter the file name for the
new data file, if the file has already been saved, selecting this
option will update the file. Click on the OK button to save the file.
Save As… - if you select this option, the Save Data As dialogue
box appears, enter the file name for the new data file and click on
the OK button to save the file. SPSS add .Sav extension to the
file name.
Opening a Data file
There are several ways of opening a data file:
Click on the Open button on the toolbar or File menu. Select Open Data…
Alternatively, when you start IBM SPSS Statistics you can select the Open Existing Data Source option
on the IBM SPSS Statistics dialogue box. The Open Data dialogue box appears find the required file and click OK.
Running an Analysis
The Analyze menu contains a variety general reporting and statistical
analysis categories. In this course we will only focus on some of the
descriptive statistic functions such as Frequencies, Descriptives and
Crosstabs.
An Introduction to IBM SPSS Statistics 19 Page 25
Selecting Cases
You can use the Select Cases function to perform an analysis on a
subset of cases, for example, “suppose we want to find out which eye
colour is more common in female respondent”. We can use the Select
Cases function to deselect the male, and then run the analysis to find out
the most common eye colour in female respondent.
To select a subset of cases:
Click on the Data menu and choose Select Cases… or click on
the Select Cases button on the toolbar, the Select Cases dialogue box appears:
An icon next to each variable on the left provides information about the data type and level of measurements
Measurement
Level
Data Type
Numeric String Date Time
Scale (continuous)
n/a
Ordinal
Nominal
To view the full description of a variable label, place the mouse
pointer on the label.
Page 26 An Introduction to IBM SPSS Statistics 19
You can also get additional labelling information by right clicking
on any one of the variable name in the list.
Under Select at the top right of the Select Cases dialogue box, All cases is the default.
Click on the radio button to select the If condition is satisfied
option, then click on the If button to display the Select Cases: If dialogue box:
An Introduction to IBM SPSS Statistics 19 Page 27
Enter the condition in the text box on the right e.g. Gender = 2 to select the female respondent. (In the data set female was coded as 2).
Click on the Continue button at the bottom of the Select Cases: If dialogue box.
Click on the OK button on the Select Cases dialogue box. Notice the row numbers on the left of your data set has a line through the number; these are the cases that have been deselected.
A filter column is inserted in your data set which displays the selected and unselected cases.
Notice at the bottom right of the status bar Filter On appears
.
To unselect the cases, open the Select Cases dialogue box.
Click on the Data menu and choose Select Cases… or click on
the Select Cases button on the toolbar (the Select Cases dialogue box appears).
Click on the radio button to the left of the All cases option to restore the entire data file to its original form.
Under Output at the bottom of the Select Cases dialogue box, Filter out unselected cases is selected; this means cases are only temporarily deselected.
Page 28 An Introduction to IBM SPSS Statistics 19
Creating a Frequency table
To create a simple frequency table:
Click on the Analyze menu, select Descriptive Statistics, then
Frequencies…
The Frequencies dialogue box appears:
Select the variable(s) that you want to use to create the groups from the source list by double-clicking on it to move it into the Variable(s) list on the right, alternatively, click on the arrow
button
Select the variable(s) you want, e.g. eye colour and gender
Click on the button with the arrow to move the variable into the Variable(s) list box.
Click on the OK button to run the procedure.
An Introduction to IBM SPSS Statistics 19 Page 29
IBM SPSS Statistics Viewer
Working with SPSS Output
The results are display in the IBM SPSS Statistics Viewer window.
Split file
You can split your data file into separate groups for analysis – e.g. its
equivalent to separately selecting each category of gender and then
running the descriptives command. It would allow you to perform a
particular analysis base on the gender; you may want to look at the
average height of males versus the average height of females.
To split the data file:
Click on the Data menu, select Split File... or click on the Split
File button on the toolbar.
You can quickly go to any item
in the Viewer by selecting it in
the Outline pane
The frequency table shows
the frequencies for each
eye colour
Page 30 An Introduction to IBM SPSS Statistics 19
The Split File dialogue box appears:
Analyze all cases, do not create groups is the default.
Select Compare groups.
Select the variable(s) that you want to use to create the groups from the source list by double-clicking on it to move it into the Variable(s) list on the right, alternatively, click on the arrow
button
Select the variable(s) you want, e.g. gender (the variable should be categorical).
Click on the button with the arrow to move the variable into the Variable(s) list box.
Click on the OK button to run the procedure.
Notice the gender column is grouped by male and female and at
the bottom right of the status bar Split File On is displayed.
To turn off Split file, click on the Data menu, select Split file, then
select on the Split File dialogue box.
Click on the OK button.
An Introduction to IBM SPSS Statistics 19 Page 31
Creating a Descriptives table
To calculate a basic Descriptives statistic:
Click on the Analyze menu, select Descriptives Statistics, then
Descriptives, the Descriptives dialogue box appears:
Select the variable(s) that you want to use to create the groups from the source list by double-clicking on it to move it into the Variable(s) list on the right, alternatively, click on the arrow
button
Select the variable(s) you want – e.g. Height.
Click on the button with the arrow to move the variable into the Variable(s): list box.
Click on the Options… button the Descriptives: Options dialogue box appears:
Page 32 An Introduction to IBM SPSS Statistics 19
Select the required option(s), by default the Mean, Std. deviation, Minimum and Maximum are selected.
Click on the OK button on the Descriptives dialogue box to run the procedure.
The table is generated on the Output viewer:
Recoding
The Recoding function is useful for combining categories; you can
reassign the values of existing variables into a new value. However,
you cannot recode numeric and string variables together.
Recoding can be done in three different ways:
We are going to use the Recode into Different Variables function.
Suppose we want to find out if more males or more females like
chocolate. We could recode chocolate into two groups:
Group 1 = dislike chocolate
Group 2 = like chocolate
Our old and new values are as follows:
Old values New values
1 = dislike chocolate 1 Group 1
2 = a little bit
3 = quite a lot
4 = very much
2
2
2 Group 2
To recode into different variables:
Click on the Transform menu.
Average height of female
Average height of male Average height of male
An Introduction to IBM SPSS Statistics 19 Page 33
Select Recode into Different Variables… The Recode into Different Variables dialogue box appears:
Select the variable you want to recode from the source list by double-clicking on it to move it into the Numeric Variable Output Variable: text box on the right, alternatively, click on the
arrow button (this is the original variable name).
Under Output Variable, enter a name for the new variable (this is the variable that will contain the recoded data).
Under Label: enter a description for the new recoded variable.
Click on the Change button to insert the name into Numeric Variable Output Variable: text box.
Click on the Old and New Values… button to display the Recode into Different Variables: Old and New Values dialogue box:
The Recode into Different Variables: Old and New Values dialogue box is used for defining the old and new values. On the left is the Old value and on the right is the New Value.
Under Old Value select Value and type 1 in the value in the text box (this is your original code).
Page 34 An Introduction to IBM SPSS Statistics 19
Under New Value, select Value and type 1 in the Value text box (this will be the new code).
Click on the Add button to list the recode of the original code into the Old New text box.
To add another group, Under Old Value click on Range: in the range text boxes enter the old code, 2 and 4 (these were your original codes).
Under New Value, select Value: and type 2 in the Value text box (this will be the new code).
Click on the Add button to list the recode of the original codes in the Old New text box.
Click on the Continue button at the bottom of the Recode into Different Variables: Old and New Values dialogue box, to go back to the Recode into Different Variables dialogue box:
Click on the OK button to perform the recode, (a new column is
inserted at the end of your data set).
A new variable column is inserted in the data set (it’s the last
column) and in variable view the new variable is inserted (it’s the
last row) you can define the new variable, e.g. 1 = dislike and
2 = like.
Cross Tabulation
You can use the Crosstabs function to explore the relationship between
two categorical variables, e.g. we are going to use the recoded variable
above to run a cross tabulation table to find out if more males or more
females like chocolate.
To create a cross tabulation table:
Click on the Analyze menu, select Descriptive Statistics then
select Crosstabs… the Crosstabs dialogue box appears:
An Introduction to IBM SPSS Statistics 19 Page 35
In the Source Variable list on the left select the required variable for Row(s), Column(s) and if required Layer 1 of 1 then click on
the arrow to copy the variable into the relevant text box, e.g. add the Recoded variable in the Row(s) and the Gender in the Column(s).
Click on the OK button to generate the cross tabulation table on
the Output viewer as shown below:
Compute function
You can use the compute function to create a new variable - let’s say
you want to increase the salary by 2.5%:
To enter a calculation that will increase the salary by 2.5%:
Click on the Transform menu
Select Compute Variable to display the Compute Variable dialogue box:
In the Target Variable: text box, enter a new name for the new
variable, e.g. ‘IncreaseSalary’.
The table reports that one
male and one female dislike
chocolates.
10 male like chocolates and
14 female like chocolates.
Page 36 An Introduction to IBM SPSS Statistics 19
In the Source Variable list on the left select the required variable,
e.g. ‘Salary’ and then click on the arrow to copy the variable into the Numeric Expression: text box.
You can use the Calculator key pad or the keyboard to enter a formula that will calculate the salary.
You can also use pre-defined functions from the Function group list on the right of the Compute Variable dialogue box.
Click on the OK button to calculate the new variable.
The new variable is inserted to the right of your data set in the Data view window, (it’s the last column) and also (in the last row) in the Variable view window.
Creating Charts
Information can be displayed graphically by using the graph function.
Graphs can also be requested at the same time when running an
analysis. However, the graph facility provides a number of
easy-to-follow steps when creating a chart. We are going to create a pie
chart.
Legacy Dialogs
To create a pie chart using the Legacy Dialogs function:
Click on the Graph menu, select Legacy Dialogs.
The Pie Charts dialogue box appears, select the Summaries of
Groups and Cases and click on the Define button.
The Define Pie:Summaries for Groups and Cases dialogue box appears:
An Introduction to IBM SPSS Statistics 19 Page 37
Enter the required variable(s) in the text box on the right.
You can add a title to your chart by clicking on the Titles… button
at the top right of the Define Pie: Summaries for Groups of
Cases dialogue box.
Click on the OK button to generate the pie chart in the Output
Viewer window.
To edit the pie chart double-click on it to open it in the Chart Editor window, then double-click again anywhere on the chart to open the Properties dialogue box.
Page 38 An Introduction to IBM SPSS Statistics 19
Click on the File menu and select Close to close the Chart
Editor to return to the SPSS Statistics Viewer.
Chart Builder
You can use the Chart Builder to build a chart from the pre-defined
gallery chart.
To build a bar chart:
Click on the Graph menu, select Chart Builder..., the Chart Builder dialogue box appears, which you can use to help you to create descriptive value labels for categorical (nominal, ordinal) variables. Press OK to define your chart.
An Introduction to IBM SPSS Statistics 19 Page 39
The Chart Builder dialogue box appears:
Click on the Gallery button on the left of the Chart Builder
dialogue box to display a list of pre-defined charts
To start building your chart - under Choose from: click on the
chart you want, e.g. Bar. If you want a description of the chart,
place your mouse pointer over the chart icon.
Drag the chart icon into the chart preview window that contains
the following information:
‘Drag Gallery chart here to use it as your starting point’ OR
‘Click the Basic Elements tab to build a chart element by
element’.
A sample bar chart is displayed without variables (This area
allows you to preview how a chart will look while you build it)
Page 40 An Introduction to IBM SPSS Statistics 19
Under Variables: click on the required variable from the source list and drag-and-drop it on the X-Axis? box and click on another variable and drag-and-drop Y-Axis.
If you make a mistake while building the chart, right click on the chart to get a short-cut menu and select undo option
You can enter a title for your chart by clicking on the Titles/Footnotes tab at the bottom of the Chart Builder dialogue box.
Select Title 1 a text box is displayed on the Element Properties dialogue box.
Type the chart tile into the Contents text box and click on the Apply button. T1 is displayed as the title, the full title will appear when you generate the chart on the Output viewer
An Introduction to IBM SPSS Statistics 19 Page 41
When you have finished adding the chart elements to the chart
Click on the OK button to generate the chart on the Output Viewer
Editing charts
You can edit the chart within the chart builder window or the Output
viewer window.
To edit the chart:
Double-click on the chart to open the Chart Editor
To edit the chart element, click on it to select it
Press the Esc key on the keyboard to deselect the element(s)
Page 42 An Introduction to IBM SPSS Statistics 19
To delete a chart element, select it from the Edit Properties of list in the Element Properties dialogue box, and then click on the
red X button on the right.
Changing the chart colour
To change the colour of the bar(s):
Click on the chart bar, a rectangle appears around all of the bars
To select an individual bar, click on it while all the other bars are
selected, you can also select multiple bars by holding down the
Ctrl key on the keyboard while you click on the bar
The tabs in the Edit Properties tabs will change depending on
the element you select in the Chart Editor
Click on the Apply button
Change the Y-axis scale
To format numbers in the Y-axis scale:
Select the Y-axis tick label
Click on the Edit menu, or Ctrl T, select Properties to open the
Properties window
Click on the Number Format tab
Click the Apply button
Change the title
To change the title:
You can edit text directly on the chart
Click on the title e.g. main title or Y-axis title to select it (the title
text is rotated into a horizontal position, with a flashing red
border)
Types the required title and press Enter to exit the Edit mode
Displaying data value labels
To display data value labels:
Open the Chart Editor
Click on the Element menu, select Data Label
The value is displayed on each bar
Thank you for completing this questionnaire. Your responses will remain totally anonymous
A Study of the Wonderful People Who Come on Research Skills Training Courses in the West Midlands
Please complete the following questions by ticking the appropriate box(es) or writing brief
information in the space provided when requested. (You do not have to tell the truth!)
1. What is your gender?
Male Female
2. What colour are your eyes?
blue brown green grey other
3. How tall are you? 180 cm
4. Which of the following best describes where you live?
a city a town the countryside don’t know
5. How far did you travel to get here today? 9km
6. How much do you like chocolate?
not at all a little bit quite a lot very much
7. What colour is your car?
silver black white green blue red other
8. How satisfied are you with your job?
very satisfied
fairly satisfied
no opinion
a little dissatisfied
very dissatisfied
9. If you could be any of the following, which would you choose to be?
Prime Minister Road Sweeper Teacher Call Centre Op
10. How much are you paid per annum? 26.500
11. What is the post code of your place of work? B2 5JS
12. Where did you go for your last holiday?
UK Europe Outside Europe Other
1
1 2 3 4 5
1 3 4
1
2
3
4
5
2
2 1 3 4
2
1 6 5 4 3 2
1 2 3 4
7
4
3 2 1