Getting started entering data and defining variables Part 1
BEEC
Dr. Christine Pereira Academic Skills Team (ASK) ask@brunel.ac.uk
1
» Purpose and use of SPSS » Open SPSS
» What is a Variable? » Defining variables in SPSS
» Entering Data
Dr. Christine Pereira
» Open and save data files » Import data from Excel
» Get SPSS on your own computer » Have a go using some sample data (or your own) ASK at Brunel (2014-15)
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
Dr. Christine Pereira
» 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.
ASK at Brunel (2014-15)
3
Dr. Christine Pereira
3
Select SPSS 20 from the list
2
Type SPSS 20 into the search box
1
Click on the Windows Start Icon
ASK at Brunel (2014-15)
4
Dr. Christine Pereira
Open NEW data file
ASK at Brunel (2014-15)
5
Enter variable names in the first column of Variable View.
Dr. Christine Pereira
We will look at all the columns in more detail shortly.
ASK at Brunel (2014-15)
6
Each variable name will appear as a column heading replacing var.
Dr. Christine Pereira
Enter the data for each variable.
ASK at Brunel (2014-15)
7
Dr. Christine Pereira
What is a variable? How do we define variables in SPSS?
ASK at Brunel (2014-15)
8
» 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…
Dr. Christine Pereira
Opinion/belief + E.g., A survey question which asks for a respondent’s level of agreement with a statement
Etc… ASK at Brunel (2014-15)
9
Dr. Christine Pereira
What is your gender?
Male or Female ASK at Brunel (2014-15)
10
Dr. Christine Pereira
How long does it take, on average, to commute into Uni? ASK at Brunel (2014-15)
11
Dr. Christine Pereira
What is your main mode of transport to Uni? ASK at Brunel (2014-15)
12
Dr. Christine Pereira
Indicate your level of agreement with this statement: “Most days, my commute causes me to feel stressed when I arrive at university�. ASK at Brunel (2014-15)
13
Dr. Christine Pereira
Country name is unique – participant ID not needed
ASK at Brunel (2014-15)
14
Dr. Christine Pereira
Number of births per 1000 people
ASK at Brunel (2014-15)
15
Dr. Christine Pereira
Surplus/deficit as % of GDP
ASK at Brunel (2014-15)
16
Dr. Christine Pereira
Gov debt as % of GDP
ASK at Brunel (2014-15)
17
Questionnaire Responses Age (in years)
Dr. Christine Pereira
3pt Likert Scale Agree No opinion Disagree
200 residents Uxbridge
Agreement with stem cell research
ASK at Brunel (2014-15)
5pt Likert Scale Strongly agree Agree Neutral Disagree Strongly disagree
Is global warming important?
18
Questionnaire Responses Age
StemCell
GlobalWarming
1
23
Agree
Strongly Agree
2
28
Undecided
Agree
3
47
Undecided
Strongly Disagree
4
62
Disagree
Undecided
…
…
…
…
Dr. Christine Pereira
Resident
ASK at Brunel (2014-15)
19
Experimental Condition
Dr. Christine Pereira
Cond 1 and 2 are independent, NOT repeated measures.
ASK at Brunel (2014-15)
20
Dr. Christine Pereira
Score on a test
ASK at Brunel (2014-15)
21
Dr. Christine Pereira
Low Lower middle Middle Upper middle High (OECD*) High (non-OECD)
ASK at Brunel (2014-15)
*OECD (Organisation for Economic Co-operation and Development)
22
Dr. Christine Pereira
East Asia & Pacific Europe & Central Asia Latin America & Caribbean Middle East & North Africa North America South Asia Sub-Saharan Africa ASK at Brunel (2014-15)
23
Caffeine and Sleep
Condition 30
Average hours slept Over 2 weeks
Dr. Christine Pereira
participants
Measure
ASK at Brunel (2014-15)
24
Caffeine and Sleep Condition
AvgHoursSlept
1
Control
7.2
2
Caffeine
6.7
3
Caffeine
6.3
4
Control
6.9
…
…
…
Dr. Christine Pereira
Participant
ASK at Brunel (2014-15)
25
Dr. Christine Pereira
Status when admitted to care facility ASK at Brunel (2014-15)
26
Dr. Christine Pereira
Anxiety level measured at 3 time points for each participant ASK at Brunel (2014-15)
27
Dr. Christine Pereira
Why not enter TIME as 1 variable like we did for STATUS?
ASK at Brunel (2014-15)
28
Dr. Christine Pereira
Birth rate per 1000 measured at 3 time points for each country
ASK at Brunel (2014-15)
29
Fitness Regime
PROFESSIONAL train
Dr. Christine Pereira
50 Participants SELF train ASK at Brunel (2014-15)
One mile time trial
BEFORE
AFTER
30
Dr. Christine Pereira
Fitness Regime Participant
Training
Before_Mile (min)
1
Self
15.3
14.1
2
Professional
16.1
14.9
3
Self
20.5
16.8
4
Self
16.8
16.2
…
…
…
…
ASK at Brunel (2014-15)
After_Mile (min)
31
Variables
Categorical
Scale
Qualitative
Quantitative
Nominal
Ordinal
(Unranked categories)
(Ranked categories)
Marital Status Political Party Eye Color
Satisfaction level Level of agreement
Not grouped
Dr. Christine Pereira
Height Weight Age 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. ASK at Brunel (2014-15)
32
Dr. Christine Pereira
Code categorical variables Enter data
ASK at Brunel (2014-15)
33
Dr. Christine Pereira
Level of Measurement?
Categorical variables need to be coded Scale variables do not need to be coded ASK at Brunel (2014-15)
34
Dr. Christine Pereira
0 0 1 0 1 1 0 1 0 1
Level of Measurement?
0 = Male 1 = Female ASK at Brunel (2014-15)
35
Dr. Christine Pereira
Level of Measurement?
Scale, does not need to be coded ASK at Brunel (2014-15)
36
Dr. Christine Pereira
Level of Measurement?
1 1 2 1 1 1 3 4 1 2
1 = tfl (i.e. public transport) 2 = Car 3 = Cycle 4 = Walk ASK at Brunel (2014-15)
37
Indicate your level of agreement with the following statement:
Dr. Christine Pereira
“Most days, my commute causes me to feel stressed when I arrive at university�.
ASK at Brunel (2014-15)
38
Dr. Christine Pereira
Level of Measurement?
ASK at Brunel (2014-15)
1 = Strongly Disagree 2 = Disagree 3 = I don’t know 4 = Agree 5 = Strongly Agree
39
Dr. Christine Pereira
Data has been coded Now we’re ready to enter it in SPSS ASK at Brunel (2014-15)
40
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Variable names • Must begin with a letter • No spaces and no special characters (except _ ) ASK at Brunel (2014-15)
41
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Type • Should (almost) always be numeric • SPSS cannot analyse non-numeric data ASK at Brunel (2014-15)
42
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Decimals • How many decimal places do you want to see in the Data View? ASK at Brunel (2014-15)
43
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Label • IMPORTANT!!! Make good labels! • Short description of the variable • This is what will be written on all graphs & tables ASK at Brunel (2014-15)
44
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• 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-15)
45
Dr. Christine Pereira
1. Enter & define variables from Variable View.
ASK at Brunel (2014-15)
46
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Missing • 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-15)
47
Dr. Christine Pereira
1. Enter & define variables from Variable View.
• Measure • Level of Measurement (Nominal, Ordinal, Scale) • By default ALL new variables are unknown • YOU must choose the appropriate measure ASK at Brunel (2014-15)
48
Dr. Christine Pereira
2. Enter data from Data View.
• Variable names • Will become column headings in Data View. ASK at Brunel (2014-15)
49
Dr. Christine Pereira
Now, let’s enter some data ASK at Brunel (2014-15)
50
Dr. Christine Pereira
Saving and Opening Data or Output Files
ASK at Brunel (2014-15)
51
Dr. Christine Pereira
ASK at Brunel (2014-15)
52
Locate a folder to save it in:
Dr. Christine Pereira
On your H drive OR On your pen drive
Name it appropriately Extension .sav ASK at Brunel (2014-15)
53
Dr. Christine Pereira
Shows output for ALL analysis run in SPSS Keeps a log of all activity of open data files Saved with the extension .spv
Everything done in SPSS is shown here, in outline form. ASK at Brunel (2014-15)
A data file was saved as SPSS Workshop Example.sav and logged in the output file.
54
New data file
Dr. Christine Pereira
New output file
ASK at Brunel (2014-15)
55
Existing data file
Dr. Christine Pereira
Existing output file
ASK at Brunel (2014-15)
56
Dr. Christine Pereira
Importing data from Excel
ASK at Brunel (2014-15)
57
Dr. Christine Pereira
Click here
ASK at Brunel (2014-15)
58
Dr. Christine Pereira
Save this file to your H: drive or pen drive
Click here ASK at Brunel (2014-15)
59
» Can be .xls OR .xlsx
» Variable names CAN be imported too Must be in row 1 of the worksheet They will be imported to the Variable View
Dr. Christine Pereira
» Data will appear in SPSS Data View
ASK at Brunel (2014-15)
60
Filename (.xlsx)
Variable names
Dr. Christine Pereira
(Row 1)
This sheet contains the coded data ASK at Brunel (2014-15)
61
Dr. Christine Pereira
Existing data file
ASK at Brunel (2014-15)
62
Select the Excel file
Dr. Christine Pereira
3
Find the folder where you saved the file
1 ASK at Brunel (2014-15)
2
Choose Excel file type to see your .xlsx 63
Dr. Christine Pereira
Choose the correct worksheet
ASK at Brunel (2014-15)
64
Variable Names
Dr. Christine Pereira
(from Row 1)
View all data ASK at Brunel (2014-15)
65
Dr. Christine Pereira
This variable name from Excel could not be used. SPSS made it a label and created a new variable name ASK at Brunel (2014-15)
66
Dr. Christine Pereira
Remember to change the level of measurement
ASK at Brunel (2014-15)
67
Watch it here https://www.screenr.com/BknN
Read it here
Dr. Christine Pereira
http://issuu.com/christinepereiraaskbrunel/doc s/download_spss_onto_your_own_compute/1
ASK at Brunel (2014-15)
68
Dr. Christine Pereira
Short video tutorials on all these topics
ASK at Brunel (2014-15)
69
Dr. Christine Pereira
ASK at Brunel (2014-15)
70
» 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
Dr. Christine Pereira
» If you choose to code missing data: First, replace all missing values with the code Second, define the missing value code in the Variable View
ASK at Brunel (2014-15)
71
» SPSS Survival Manual, 4th Edition (2010) by Julie Pallant. » SPSS Survival Manual, 5th Edition (2013) by Julie Pallant.
Dr. Christine Pereira
» Discovering Statistics Using SPSS, 3rd Edition (2009) by Andy Field. » Discovering Statistics Using SPSS, 4th Edition (2013) by Andy Field.
ASK at Brunel (2014-15)
72
» Caffeinated drinks: http://www.google.co.uk/url?sa=i&source=images&cd=&cad=rja&uact=8&docid=Y9I7e2I59JjPCM&tbnid=sr6aMiG082v7UM&ved=0CAgQjRw &url=http%3A%2F%2Fslapenergydrink.com%2Fenergy-drinkscaffeine&ei=N30lVIqPFKid7ga_44EQ&psig=AFQjCNEPc4cpRWQBaBOKS9zoUsC_0DaV9w&ust=1411829431470911
» People in experiment: http://www.google.co.uk/imgres?imgurl=http%3A%2F%2Fezquants.weebly.com%2Fuploads%2F1%2F3%2F4%2F4%2F13445934%2F47970_o rig.gif&imgrefurl=http%3A%2F%2Fezquants.weebly.com%2Ft-test--the-nullhypothesis.html&h=270&w=315&tbnid=pCG2pi0OBEM6yM%3A&zoom=1&docid=9W6CFf18UFyRM&ei=YoIlVKKBBLSS7AbotoGABg&tbm=isch&ved=0CHEQMyhKMEo&iact=rc&uact=3&dur=350&page=4&start=73&ndsp=23
» Placebo: http://www.google.co.uk/imgres?imgurl=http%3A%2F%2Fimage.yaymicro.com%2Frz_1210x1210%2F0%2F5e9%2Fplacebo--pill-with-no-medicinal-effects-in-control-group-of-stu-5e98de.jpg&imgrefurl=http%3A%2F%2Fyaymicro.com%2Fstock-image%2Fplacebo--pill-with-no-medicinal-effects-in-control-group-ofstu%2F1662248&h=1028&w=1210&tbnid=EUdctbyqvrlO4M%3A&zoom=1&docid=aAnQenPGWluQ7M&ei=YoIlVKKBBLSS7AbotoGABg&tbm=i sch&ved=0CGgQMyhBMEE&iact=rc&uact=3&dur=272&page=3&start=46&ndsp=27
Dr. Christine Pereira
» Caffeine tablets: http://www.google.co.uk/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&docid=0NqTET17JodZNM&tbnid=eB_SUbuyiKHgM:&ved=0CAcQjRw&url=http%3A%2F%2Fwww.drugstore.com%2Fnatrol-caffeine-100-mg-fast-dissolve-tabletsmocha%2Fqxp450974&ei=pIMlVIqzHIfjOnZgDA&bvm=bv.76247554,d.ZGU&psig=AFQjCNGvhc0bHr1wLewiqAgLuep9lV5BGA&ust=1411831016411090
» Sleeping: http://www.google.co.uk/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&docid=9c3klNdFBhfBCM&tbnid=KUe-mlLOZJGBM:&ved=0CAcQjRw&url=http%3A%2F%2Fwww.rewordit.org%2Fwhy-your-body-love-tosleep%2F&ei=boUlVNKnIIy_PPfPgcAB&bvm=bv.76247554,d.ZGU&psig=AFQjCNG7qafjwsNMdRYchIgLrBb42tSeiA&ust=1411831519554208
ASK at Brunel (2014-15)
73
» Silhouette runners, silhouette collection: running, vol:42. http://freedesignfile.com/upload/2012/10/running_people_03.jpg
» Clip art for professional train participants: http://www.google.co.uk/imgres?imgurl=http%3A%2F%2Fwww.livingwellcic.com%2Fwp-content%2Fuploads%2F2013%2F07%2FHIV-andStigma-Study.jpg&imgrefurl=http%3A%2F%2Fwww.livingwellcic.com%2Fnews%2Fhiv-services%2Fhiv-andstigma%2F&h=400&w=472&tbnid=noisZZOR1Xx1AM%3A&zoom=1&docid=CYtMWBe02aU7M&ei=hUMpVJWrJsP0apLMgUA&tbm=isch&ved=0CC8QMygHMAc&iact=rc&uact=3&dur=267&page=1&start=0&ndsp=14
» Clip art for self-train participants:
Dr. Christine Pereira
http://www.google.co.uk/url?sa=i&rct=j&q=&esrc=s&frm=1&source=images&cd=&cad=rja&uact=8&docid=IbKSqXDNyckLHM&tbnid=CGxPa Nadhe4VdM:&ved=0CAcQjRw&url=http%3A%2F%2Fwww.nearingkolob.com%2Fmormonism-dead-zombie-rituals%2F&ei=0MpVNW6IsGVaqqsgKAG&bvm=bv.76247554,d.d2s&psig=AFQjCNH1emvHrdw_DEn15T4LJV7cjxhrfw&ust=1412076805987563
ASK at Brunel (2014-15)
74
Dr. Christine Pereira
ASK at Brunel (2014-15)
75