You are on page 1of 51

1

» Purpose and use of SPSS


» Open SPSS
» What is a Variable?
» Defining variables in SPSS
» Entering Data
» Open and save data files
» Import data from Excel
» Handling missing data

2
» SPSS is a Statistical Software Package
» SPSS is a tool
 It only does what it’s ‘told’ to do.
 It does not think for you
 It is not a black box
» You need to know the correct statistics for your
research BEFORE using SPSS.
» If you understand the statistics, then you are ready to
do analysis in SPSS.

3
Select SPSS 21
3
from the list

Type SPSS 20 into the


2
search box

Click on the Windows


1
Start Icon
4
Open NEW
data file
Dr. Christine Pereira

ASK at Brunel (2014) 5


Enter variable names in the first
column of Variable View.
Dr. Christine Pereira

ASK at Brunel (2014) 6


Each variable name will appear as a
column heading replacing var.

Enter the data for each variable.


Dr. Christine Pereira

ASK at Brunel (2014) 7


What is a variable?
How do we define variables in SPSS?
Dr. Christine Pereira

ASK at Brunel (2014) 10


» A measurement:
 A characteristic
+ E.g., Gender, Age, Height, Weight…
 Time points
+ E.g., pre-test, post-test, T0, T1, T2…
 Experimental Condition
+ E.g., Condition, Experimental group…
 Opinion/belief
+ E.g., A survey question which asks for a respondent’s level of
Dr. Christine Pereira

agreement with a statement


 Etc…

ASK at Brunel (2014) 11


Dr. Christine Pereira

ASK at Brunel (2014) 13


Variables

Categorical Scale
Qualitative Quantitative

Nominal Ordinal Not grouped


(Unranked categories) (Ranked categories)  Height
 Marital Status  Weight
 Political Party  Satisfaction level  Age
 Eye Color  Level of agreement  No. of cars
 No. of students

• In SPSS, data is either Nominal, Ordinal or Scale.


• It is essential to classify data correctly.
- Incorrect classification…
may result in incorrect analyses.
31
Code categorical variables
Enter data

32
Level of
Measurement?
Dr. Christine Pereira

Categorical variables need to be coded


Scale variables do not need to be coded
ASK at Brunel (2014) 33
0
0
1
0
1
Level of
1
0
Measurement?
1
0
1
Dr. Christine Pereira

0 = Male
1 = Female
ASK at Brunel (2014) 34
Level of
Measurement?
Dr. Christine Pereira

Scale, does not


need to be coded
ASK at Brunel (2014) 35
1
1
2
Level of 1
1

Measurement? 1
3
4
1
2

1 = tfl (i.e. public transport)


2 = Car
3 = Cycle
4 = Walk
36
Indicate your level of agreement with
the following statement:

“Most days, my commute causes me


to feel stressed when I arrive at
university”.
Dr. Christine Pereira

ASK at Brunel (2014) 37


Level of
Measurement?

1 = Strongly Disagree
2 = Disagree
3 = I don’t know
4 = Agree
5 = Strongly Agree 38
Data has been coded
Now we’re ready to enter it in SPSS
39
1. Enter & define variables from Variable View.

• Variable names
• Must begin with a letter
• No spaces and no special characters (except _ )

40
1. Enter & define variables from Variable View.
Dr. Christine Pereira

• Type
• Should (almost) always be numeric
• SPSS cannot analyse non-numeric data

ASK at Brunel (2014) 41


1. Enter & define variables from Variable View.
Dr. Christine Pereira

• Decimals
• How many decimal places do you want to see in
the Data View?

ASK at Brunel (2014) 42


1. Enter & define variables from Variable View.

• Label
Dr. Christine Pereira

• IMPORTANT!!! Make good labels!


• Short description of the variable
• This is what will be written on all graphs & tables
ASK at Brunel (2014) 43
1. Enter & define variables from Variable View.
Dr. Christine Pereira

• Values (i.e., Value labels)


• IMPORTANT!!! - Tell SPSS what all the codes represent!
• This is what is written on all graphs & tables

ASK at Brunel (2014) 44


1. Enter & define variables from Variable View.
Dr. Christine Pereira

ASK at Brunel (2014) 45


1. Enter & define variables from Variable View.

• Missing
Dr. Christine Pereira

• Missing data can be coded too


• Chose a number not in the data, like 99 or 999
• Replace all missing values in your data with this code first
ASK at Brunel (2014) 46
1. Enter & define variables from Variable View.

• Measure
Dr. Christine Pereira

• Level of Measurement (Nominal, Ordinal, Scale)


• By default ALL new variables are unknown
• YOU must choose the appropriate measure

ASK at Brunel (2014) 47


2. Enter data from Data View.
Dr. Christine Pereira

• Variable names
• Will become column headings in Data View.
ASK at Brunel (2014) 48
Dr. Christine Pereira

Now, let’s enter some data


ASK at Brunel (2014) 49
Saving and Opening Data or Output Files
Dr. Christine Pereira

ASK at Brunel (2014) 50


Dr. Christine Pereira

ASK at Brunel (2014) 51


Locate a folder to save
it in:

 On your H drive OR
 On your pen drive
Dr. Christine Pereira

 Name it appropriately
 Extension . sav

ASK at Brunel (2014) 52


 Shows output for ALL analysis run in SPSS
 Keeps a log of all activity of open data files
 Saved with the extension .spv
Dr. Christine Pereira

Everything done in A data file was saved as SPSS


SPSS is shown here, in Workshop Example.sav and logged
outline form. in the output file.
ASK at Brunel (2014) 53
New
data file

New
output file
Dr. Christine Pereira

ASK at Brunel (2014) 54


Existing
data
file

Existing
output file
Dr. Christine Pereira

ASK at Brunel (2014) 55


Importing data from Excel
Dr. Christine Pereira

ASK at Brunel (2014) 56


Existing
data file
Dr. Christine Pereira

ASK at Brunel (2014) 62


Find the folder
where you 2
saved the file
3
Select the
Excel file
Dr. Christine Pereira

Choose Excel file type to


1
see your .xlsx
ASK at Brunel (2014) 63
Choose the
correct
worksheet
Dr. Christine Pereira

ASK at Brunel (2014) 64


Variable
Names
(from Row 1)
Dr. Christine Pereira

View all data


ASK at Brunel (2014) 65
This variable name from Excel could not be
Dr. Christine Pereira

used. SPSS made it a label and created a new


variable name

ASK at Brunel (2014) 66


How to handle missing data
Dr. Christine Pereira

ASK at Brunel (2014) 67


» Any blank (i.e., missing) data is automatically
considered missing by SPSS.
 It will not be included in the analysis.
 This means you DO NOT have to code missing data

» Why code missing values if you don’t have to?


 Sometimes data accidently gets deleted. If missing values are
coded then you know a blank space shouldn’t be there.
 There is more than one reason data is missing and you want
to distinguish between them.
Dr. Christine Pereira

+ E.g., A participant chose not to answer a survey question or question


was not applicable to them – you may want to record these as
different kinds of missing data.

ASK at Brunel (2014) 68


There are 3 missing
values for
TravelTimemin
Dr. Christine Pereira

• Replace missing values with a code


• Use a code that will not occur for the variable
• Let’s use -1, as negative time is not possible
ASK at Brunel (2014) 69
1
Dr. Christine Pereira

ASK at Brunel (2014) 70


Select the
variable you 2
want to recode

Click here to
recode the 3
variable
Dr. Christine Pereira

ASK at Brunel (2014) 71


4
Enter the
code as the 5
new value

Click Add.
MISSING -> -1 6
Dr. Christine Pereira

will appear here


Click Continue
7
then Click OK
ASK at Brunel (2014) 72
Missing values have
been replaced with
-1 for
TravelTimemin
Dr. Christine Pereira

ASK at Brunel (2014) 73


Remember…
8 From Variable View
Define the missing
values
Dr. Christine Pereira

• Discrete (whole numbers)


• Enter missing value codes used for the variable (e.g., -1)
• Click OK
ASK at Brunel (2014) 74
Dr. Christine Pereira

 This is only a code – it tells SPSS what value(s) represent


missing values.
 It does not replace missing values with the code for you!
ASK at Brunel (2014) 75
» Variables go in columns
» Categorical data should be coded first
» If you import data from Excel, make sure to:
 Put variable names in the first row
 Code your categorical data first, then import codes

» If you choose to code missing data:


 First, replace all missing values with the code
Dr. Christine Pereira

 Second, define the missing value code in the Variable View

ASK at Brunel (2014) 76

You might also like