SlideShare a Scribd company logo
1 of 42
SPSS for Beginners 
1
What is in this workshop 
• SPSS interface: data view and variable view 
• How to enter data in SPSS 
• How to import external data into SPSS 
• How to clean and edit data 
• How to transform variables 
• How to sort and select cases 
• How to get descriptive statistics 
2
Data used in the workshop 
• We use 2009 Youth Risk Behavior Surveillance 
System (YRBSS, CDC) as an example. 
– YRBSS monitors priority health-risk behaviors and 
the prevalence of obesity and asthma among 
youth and young adults. 
– The target population is high school students 
– Multiple health behaviors include drinking, 
smoking, exercise, eating habits, etc. 
3
SPSS interface 
• Data view 
– The place to enter data 
– Columns: variables 
– Rows: records 
• Variable view 
– The place to enter variables 
– List of all variables 
– Characteristics of all variables 
4
Before the data entry 
• You need a code book/scoring guide 
• You give ID number for each case (NOT real 
identification numbers of your subjects) if you 
use paper survey. 
• If you use online survey, you need something 
to identify your cases. 
• You also can use Excel to do data entry. 
5
Example of a code book 
6 
A code book is about how you code your 
variables. What are in code book? 
1.Variable names 
2.Values for each response option 
3.How to recode variables
Enter data in SPSS 19.0 
7 
Columns: 
variables 
Rows: cases 
Under Data 
View
Enter variables 
8 
1. Click this 
Window 
1. Click Variable View 
2. Type variable name under 
Name column (e.g. Q01). 
NOTE: Variable name can be 64 
bytes long, and the first 
character must be a letter or 
one of the characters @, #, or 
$. 
3. Type: Numeric, string, etc. 
4. Label: description of variables. 
2. Type 
variable name 
3. Type: 
numeric or 
string 
4. Description 
of variable
Enter variables 
9 
Based on your 
code book!
Enter cases 
10 
Under Data 
View 
1. Two variables in the data set. 
2. They are: Code and Q01. 
3. Code is an ID variable, used to identify individual case 
(NOT people’s real IDs). 
4. Q01 is about participants’ ages: 1 = 12 years or 
younger, 2 = 13 years, 3 = 14 years…
Import data from Excel 
• Select File Open Data 
• Choose Excel as file type 
• Select the file you want to import 
• Then click Open 
11
Open Excel files in SPSS 
12
Import data from CVS file 
• CVS is a comma-separated values file. 
• If you use Qualtrics to collect data (online 
survey), you will get a CVS data file. 
• Select File Open Data 
• Choose All files as file type 
• Select the file you want to import 
• Then click Open 
13
Continue 
14
Continue 
15
Continue 
16
Continue 
17
Continue 
18
Continue 
19
Continue 
20 
Save this file 
as SPSS data
Clean data after import data files 
• Key in values and labels for each variable 
• Run frequency for each variable 
• Check outputs to see if you have variables 
with wrong values. 
• Check missing values and physical surveys if 
you use paper surveys, and make sure they 
are real missing. 
• Sometimes, you need to recode string 
variables into numeric variables 
21
Continue 
22 
Wrong 
entries
Variable transformation 
• Recode variables 
23 
1. Select Transform Recode 
into Different Variables 
2. Select variable that you want 
to transform (e.g. Q20): we 
want 
1= Yes and 0 = No 
3. Click Arrow button to put 
your variable into the right 
window 
4. Under Output Variable: type 
name for new variable and 
label, then click Change 
5. Click Old and New Values
Continue 
6. Type 1 under Old Value 
and 1 under New Value, 
click Add. Then type 2 
under Old Value, and 0 
under New Value, click 
Add. 
7. Click Continue after 
finish all the changes. 
8. Click Ok 
24
Variable transformation 
Compute variable (use YRBSS 2009 data) 
Example 1. Create a new variable: drug_use (During the past 30 
days, any use of cigarettes, alcohol, and marijuana is defined as 
use, else as non-use). There are two categories for the new 
variable (use vs. non-use). Coding: 1= Use and 0 = Non-use 
1. Use Q30, Q41, and Q47 from 2009 YRBSS survey 
2. Non-users means those who answered 0 days/times to all three 
questions. 
3. Go to Transform Compute Variable 
25
Continue 
4. Type “drug_use” under 
Target Variable 
5. Type “0” under Numeric 
Expression. 0 means 
Non-use 
6. Click If button. 
26
Continue 
7. With help of that 
Arrow button, type 
Q30= 1 & Q41 = 1 & Q47= 1 
then click Continue 
8. Do the same thing for 
Use, but the numeric 
expression is different: 
Q30> 1 | Q41> 1 | Q47>1 
27 
AND OR
Continue 
9. Click OK 
10. After click OK, 
a small window asks 
if you want to 
change existing 
variable because 
drug_use was already 
created when you 
first define non-use. 
11. Click ok. 
28
Continue 
Compute variables 
Example 2. Create a new variable drug_N that 
assesses total number of drugs that adolescents used 
during the last 30 days. 
1.Use Q30 (cigarettes), 41 (alcohol), 47 (marijuana), and 
50 (cocaine). The number of drugs used should be 
between 0 and 4. 
2.First, recode all four variables into two categories: 0 = 
non-use (0 days), 1 = use (at least 1 day/time) 
3.Four variables have 6 or 7 categories 
29
Continue 
4. Recode four variables: 1 (old) = 0 (new), 2-6/7 (old) = 1 (New). 
5. Then select Transform Compute Variable 
30
Continue 
6. Type drug_N under Target Variable 
7. Numeric Expression: SUM (Q30r,Q41r,Q47r,Q50r) 
8. Click OK 
31
Continue 
• Compute variables 
– Example 3: Convert string variable into numeric 
variable 
32 
1. Enter 1 at Numeric 
Expression. 
2. Click If button and type 
Q2 = ‘Female’ 
3. Then click Ok. 
4. Enter 2 at Numeric 
Expression. 
5. Click If button and type 
Q2 = ‘Male’ 
6. Then click Ok
Sort and select cases 
• Sort cases by variables: Data Sort Cases 
• You can use Sort Cases to find missing. 
33
Sort and select cases 
• Select cases 
– Example 1. Select Females for analysis. 
1.Go to Data Select Cases 
2.Under Select: check the second one 
3.Click If button 
34
Continue 
4. Q2 (gender) = 1, 
1 means Female 
5. Click Continue 
6. Click Ok 
35 
Unselected 
cases : 
Q2 = 2
Sort and select cases 
7. You will see a new variable: filter_$ (Variable 
view) 
36
Sort and select cases 
• Select cases 
– Example 2. Select cases who used any of cigarettes, alcohol, and marijuana 
during the last 30 days. 
1. Data Select Cases 
2. Click If button 
3. Type Q30 > 1 | Q41 > 1 | Q47 > 1, click Continue 
37
Basic statistical analysis 
• Descriptive statistics 
– Purposes: 
1.Find wrong entries 
2.Have basic knowledge about the sample and 
targeted variables in a study 
3.Summarize data 
Analyze Descriptive statistics Frequency 
38
Continue 
39
Frequency table 
40
41 
1. Skewness: a measure of the 
asymmetry of a distribution. 
The normal distribution is 
symmetric and has a skewness 
value of zero. 
Positive skewness: a long right tail. 
Negative skewness: a long left tail. 
Departure from symmetry : a 
skewness value more than twice 
its standard error. 
2. Kurtosis: A measure of the extent 
to which observations cluster around 
a central point. For a normal 
distribution, the value of the kurtosis 
statistic is zero. Leptokurtic data 
values are more peaked, whereas 
platykurtic data values are flatter and 
more dispersed along the X axis. 
Normal 
Curve
42

More Related Content

What's hot

Final spss hands on training (descriptive analysis) may 24th 2013
Final spss  hands on training (descriptive analysis) may 24th 2013Final spss  hands on training (descriptive analysis) may 24th 2013
Final spss hands on training (descriptive analysis) may 24th 2013
Tin Myo Han
 
Introduction To SPSS
Introduction To SPSSIntroduction To SPSS
Introduction To SPSS
Phi Jack
 
اىفناىنمفبانفيا
اىفناىنمفبانفيااىفناىنمفبانفيا
اىفناىنمفبانفيا
Bisan Rjoub
 
Aminullah assagaf model regresi lengkap 10 agustus 2021_(sobel, path, outlier)
Aminullah assagaf model regresi lengkap  10 agustus 2021_(sobel, path, outlier)Aminullah assagaf model regresi lengkap  10 agustus 2021_(sobel, path, outlier)
Aminullah assagaf model regresi lengkap 10 agustus 2021_(sobel, path, outlier)
Aminullah Assagaf
 

What's hot (20)

Final spss hands on training (descriptive analysis) may 24th 2013
Final spss  hands on training (descriptive analysis) may 24th 2013Final spss  hands on training (descriptive analysis) may 24th 2013
Final spss hands on training (descriptive analysis) may 24th 2013
 
Statistical Package for Social Science (SPSS)
Statistical Package for Social Science (SPSS)Statistical Package for Social Science (SPSS)
Statistical Package for Social Science (SPSS)
 
An Introduction to SPSS
An Introduction to SPSSAn Introduction to SPSS
An Introduction to SPSS
 
Spss
SpssSpss
Spss
 
Introduction To SPSS
Introduction To SPSSIntroduction To SPSS
Introduction To SPSS
 
Data processing & Analysis: SPSS an overview
Data processing & Analysis: SPSS an overviewData processing & Analysis: SPSS an overview
Data processing & Analysis: SPSS an overview
 
Spss beginners
Spss beginnersSpss beginners
Spss beginners
 
(Manual spss)
(Manual spss)(Manual spss)
(Manual spss)
 
Spss & rsm copy
Spss & rsm   copySpss & rsm   copy
Spss & rsm copy
 
Data entry in Excel and SPSS
Data entry in Excel and SPSS Data entry in Excel and SPSS
Data entry in Excel and SPSS
 
QUANTITATIVE DATA ANALYSIS HOW TO DO A T-TEST ON MS-EXCEL AND SPSS
QUANTITATIVE DATA ANALYSIS HOW TO DO A T-TEST ON MS-EXCEL AND SPSSQUANTITATIVE DATA ANALYSIS HOW TO DO A T-TEST ON MS-EXCEL AND SPSS
QUANTITATIVE DATA ANALYSIS HOW TO DO A T-TEST ON MS-EXCEL AND SPSS
 
Data analysis using spss
Data analysis using spssData analysis using spss
Data analysis using spss
 
Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02
 
SPSS-SYNTAX
SPSS-SYNTAXSPSS-SYNTAX
SPSS-SYNTAX
 
Software packages for statistical analysis - SPSS
Software packages for statistical analysis - SPSSSoftware packages for statistical analysis - SPSS
Software packages for statistical analysis - SPSS
 
univariate and bivariate analysis in spss
univariate and bivariate analysis in spss univariate and bivariate analysis in spss
univariate and bivariate analysis in spss
 
SPSS
SPSSSPSS
SPSS
 
spss teaching
spss teachingspss teaching
spss teaching
 
اىفناىنمفبانفيا
اىفناىنمفبانفيااىفناىنمفبانفيا
اىفناىنمفبانفيا
 
Aminullah assagaf model regresi lengkap 10 agustus 2021_(sobel, path, outlier)
Aminullah assagaf model regresi lengkap  10 agustus 2021_(sobel, path, outlier)Aminullah assagaf model regresi lengkap  10 agustus 2021_(sobel, path, outlier)
Aminullah assagaf model regresi lengkap 10 agustus 2021_(sobel, path, outlier)
 

Similar to Spss beginners

Assignment 2 Tests of SignificanceThroughout this assignment yo.docx
Assignment 2 Tests of SignificanceThroughout this assignment yo.docxAssignment 2 Tests of SignificanceThroughout this assignment yo.docx
Assignment 2 Tests of SignificanceThroughout this assignment yo.docx
rock73
 
Need a nonplagiarised paper and a form completed by 1006015 before.docx
Need a nonplagiarised paper and a form completed by 1006015 before.docxNeed a nonplagiarised paper and a form completed by 1006015 before.docx
Need a nonplagiarised paper and a form completed by 1006015 before.docx
lea6nklmattu
 
Experimental designs and data analysis in the field of Agronomy science by ma...
Experimental designs and data analysis in the field of Agronomy science by ma...Experimental designs and data analysis in the field of Agronomy science by ma...
Experimental designs and data analysis in the field of Agronomy science by ma...
Manoj Sharma
 
I need this done ASAP, You have to have SPSS Software on your comput.docx
I need this done ASAP, You have to have SPSS Software on your comput.docxI need this done ASAP, You have to have SPSS Software on your comput.docx
I need this done ASAP, You have to have SPSS Software on your comput.docx
anthonybrooks84958
 
Assignment 2 Tests of SignificanceThroughout this assignmen.docx
Assignment 2 Tests of SignificanceThroughout this assignmen.docxAssignment 2 Tests of SignificanceThroughout this assignmen.docx
Assignment 2 Tests of SignificanceThroughout this assignmen.docx
karenahmanny4c
 

Similar to Spss beginners (20)

Assignment 2 Tests of SignificanceThroughout this assignment yo.docx
Assignment 2 Tests of SignificanceThroughout this assignment yo.docxAssignment 2 Tests of SignificanceThroughout this assignment yo.docx
Assignment 2 Tests of SignificanceThroughout this assignment yo.docx
 
Need a nonplagiarised paper and a form completed by 1006015 before.docx
Need a nonplagiarised paper and a form completed by 1006015 before.docxNeed a nonplagiarised paper and a form completed by 1006015 before.docx
Need a nonplagiarised paper and a form completed by 1006015 before.docx
 
Spss beginners
Spss beginnersSpss beginners
Spss beginners
 
Experimental designs and data analysis in the field of Agronomy science by ma...
Experimental designs and data analysis in the field of Agronomy science by ma...Experimental designs and data analysis in the field of Agronomy science by ma...
Experimental designs and data analysis in the field of Agronomy science by ma...
 
Introduction-to-Statistics.pptx
Introduction-to-Statistics.pptxIntroduction-to-Statistics.pptx
Introduction-to-Statistics.pptx
 
chap1.ppt
chap1.pptchap1.ppt
chap1.ppt
 
I need this done ASAP, You have to have SPSS Software on your comput.docx
I need this done ASAP, You have to have SPSS Software on your comput.docxI need this done ASAP, You have to have SPSS Software on your comput.docx
I need this done ASAP, You have to have SPSS Software on your comput.docx
 
SPSS FINAL.pdf
SPSS FINAL.pdfSPSS FINAL.pdf
SPSS FINAL.pdf
 
Clinical case studies and SPSS
Clinical case studies and SPSSClinical case studies and SPSS
Clinical case studies and SPSS
 
EXPLORATORY DATA ANALYSIS
EXPLORATORY DATA ANALYSISEXPLORATORY DATA ANALYSIS
EXPLORATORY DATA ANALYSIS
 
Spss basic Dr Marwa Zalat
Spss basic Dr Marwa ZalatSpss basic Dr Marwa Zalat
Spss basic Dr Marwa Zalat
 
Kofi nyanteng cleaning and screning data using spss
Kofi nyanteng   cleaning and screning data using spssKofi nyanteng   cleaning and screning data using spss
Kofi nyanteng cleaning and screning data using spss
 
Doing a good write up modified
Doing a good write up modifiedDoing a good write up modified
Doing a good write up modified
 
Assignment 2 Tests of SignificanceThroughout this assignmen.docx
Assignment 2 Tests of SignificanceThroughout this assignmen.docxAssignment 2 Tests of SignificanceThroughout this assignmen.docx
Assignment 2 Tests of SignificanceThroughout this assignmen.docx
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Advanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-ExcelAdvanced Filter Concepts in MS-Excel
Advanced Filter Concepts in MS-Excel
 
01 Introduction (1).pptx
01 Introduction (1).pptx01 Introduction (1).pptx
01 Introduction (1).pptx
 
SPSS
SPSSSPSS
SPSS
 
Day1, session i- spss
Day1, session i- spssDay1, session i- spss
Day1, session i- spss
 
Grade 7 Statistics
Grade 7 StatisticsGrade 7 Statistics
Grade 7 Statistics
 

More from Silam Barasan (6)

Padithathil pidithathu
Padithathil pidithathuPadithathil pidithathu
Padithathil pidithathu
 
5866
58665866
5866
 
2,.
2,.2,.
2,.
 
Leaves
LeavesLeaves
Leaves
 
information technology
information technologyinformation technology
information technology
 
Brain teasing questions 2
Brain teasing questions 2Brain teasing questions 2
Brain teasing questions 2
 

Recently uploaded

The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
Abortion pills in Kuwait Cytotec pills in Kuwait
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 

Recently uploaded (20)

Cracking the 'Career Pathing' Slideshare
Cracking the 'Career Pathing' SlideshareCracking the 'Career Pathing' Slideshare
Cracking the 'Career Pathing' Slideshare
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165Lucknow Housewife Escorts  by Sexy Bhabhi Service 8250092165
Lucknow Housewife Escorts by Sexy Bhabhi Service 8250092165
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Rice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna ExportsRice Manufacturers in India | Shree Krishna Exports
Rice Manufacturers in India | Shree Krishna Exports
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Falcon Invoice Discounting: Aviate Your Cash Flow Challenges
Falcon Invoice Discounting: Aviate Your Cash Flow ChallengesFalcon Invoice Discounting: Aviate Your Cash Flow Challenges
Falcon Invoice Discounting: Aviate Your Cash Flow Challenges
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
New 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateNew 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck Template
 
How to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League CityHow to Get Started in Social Media for Art League City
How to Get Started in Social Media for Art League City
 
Power point presentation on enterprise performance management
Power point presentation on enterprise performance managementPower point presentation on enterprise performance management
Power point presentation on enterprise performance management
 
Buy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail AccountsBuy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail Accounts
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 Updated
 
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGParadip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 

Spss beginners

  • 2. What is in this workshop • SPSS interface: data view and variable view • How to enter data in SPSS • How to import external data into SPSS • How to clean and edit data • How to transform variables • How to sort and select cases • How to get descriptive statistics 2
  • 3. Data used in the workshop • We use 2009 Youth Risk Behavior Surveillance System (YRBSS, CDC) as an example. – YRBSS monitors priority health-risk behaviors and the prevalence of obesity and asthma among youth and young adults. – The target population is high school students – Multiple health behaviors include drinking, smoking, exercise, eating habits, etc. 3
  • 4. SPSS interface • Data view – The place to enter data – Columns: variables – Rows: records • Variable view – The place to enter variables – List of all variables – Characteristics of all variables 4
  • 5. Before the data entry • You need a code book/scoring guide • You give ID number for each case (NOT real identification numbers of your subjects) if you use paper survey. • If you use online survey, you need something to identify your cases. • You also can use Excel to do data entry. 5
  • 6. Example of a code book 6 A code book is about how you code your variables. What are in code book? 1.Variable names 2.Values for each response option 3.How to recode variables
  • 7. Enter data in SPSS 19.0 7 Columns: variables Rows: cases Under Data View
  • 8. Enter variables 8 1. Click this Window 1. Click Variable View 2. Type variable name under Name column (e.g. Q01). NOTE: Variable name can be 64 bytes long, and the first character must be a letter or one of the characters @, #, or $. 3. Type: Numeric, string, etc. 4. Label: description of variables. 2. Type variable name 3. Type: numeric or string 4. Description of variable
  • 9. Enter variables 9 Based on your code book!
  • 10. Enter cases 10 Under Data View 1. Two variables in the data set. 2. They are: Code and Q01. 3. Code is an ID variable, used to identify individual case (NOT people’s real IDs). 4. Q01 is about participants’ ages: 1 = 12 years or younger, 2 = 13 years, 3 = 14 years…
  • 11. Import data from Excel • Select File Open Data • Choose Excel as file type • Select the file you want to import • Then click Open 11
  • 12. Open Excel files in SPSS 12
  • 13. Import data from CVS file • CVS is a comma-separated values file. • If you use Qualtrics to collect data (online survey), you will get a CVS data file. • Select File Open Data • Choose All files as file type • Select the file you want to import • Then click Open 13
  • 20. Continue 20 Save this file as SPSS data
  • 21. Clean data after import data files • Key in values and labels for each variable • Run frequency for each variable • Check outputs to see if you have variables with wrong values. • Check missing values and physical surveys if you use paper surveys, and make sure they are real missing. • Sometimes, you need to recode string variables into numeric variables 21
  • 22. Continue 22 Wrong entries
  • 23. Variable transformation • Recode variables 23 1. Select Transform Recode into Different Variables 2. Select variable that you want to transform (e.g. Q20): we want 1= Yes and 0 = No 3. Click Arrow button to put your variable into the right window 4. Under Output Variable: type name for new variable and label, then click Change 5. Click Old and New Values
  • 24. Continue 6. Type 1 under Old Value and 1 under New Value, click Add. Then type 2 under Old Value, and 0 under New Value, click Add. 7. Click Continue after finish all the changes. 8. Click Ok 24
  • 25. Variable transformation Compute variable (use YRBSS 2009 data) Example 1. Create a new variable: drug_use (During the past 30 days, any use of cigarettes, alcohol, and marijuana is defined as use, else as non-use). There are two categories for the new variable (use vs. non-use). Coding: 1= Use and 0 = Non-use 1. Use Q30, Q41, and Q47 from 2009 YRBSS survey 2. Non-users means those who answered 0 days/times to all three questions. 3. Go to Transform Compute Variable 25
  • 26. Continue 4. Type “drug_use” under Target Variable 5. Type “0” under Numeric Expression. 0 means Non-use 6. Click If button. 26
  • 27. Continue 7. With help of that Arrow button, type Q30= 1 & Q41 = 1 & Q47= 1 then click Continue 8. Do the same thing for Use, but the numeric expression is different: Q30> 1 | Q41> 1 | Q47>1 27 AND OR
  • 28. Continue 9. Click OK 10. After click OK, a small window asks if you want to change existing variable because drug_use was already created when you first define non-use. 11. Click ok. 28
  • 29. Continue Compute variables Example 2. Create a new variable drug_N that assesses total number of drugs that adolescents used during the last 30 days. 1.Use Q30 (cigarettes), 41 (alcohol), 47 (marijuana), and 50 (cocaine). The number of drugs used should be between 0 and 4. 2.First, recode all four variables into two categories: 0 = non-use (0 days), 1 = use (at least 1 day/time) 3.Four variables have 6 or 7 categories 29
  • 30. Continue 4. Recode four variables: 1 (old) = 0 (new), 2-6/7 (old) = 1 (New). 5. Then select Transform Compute Variable 30
  • 31. Continue 6. Type drug_N under Target Variable 7. Numeric Expression: SUM (Q30r,Q41r,Q47r,Q50r) 8. Click OK 31
  • 32. Continue • Compute variables – Example 3: Convert string variable into numeric variable 32 1. Enter 1 at Numeric Expression. 2. Click If button and type Q2 = ‘Female’ 3. Then click Ok. 4. Enter 2 at Numeric Expression. 5. Click If button and type Q2 = ‘Male’ 6. Then click Ok
  • 33. Sort and select cases • Sort cases by variables: Data Sort Cases • You can use Sort Cases to find missing. 33
  • 34. Sort and select cases • Select cases – Example 1. Select Females for analysis. 1.Go to Data Select Cases 2.Under Select: check the second one 3.Click If button 34
  • 35. Continue 4. Q2 (gender) = 1, 1 means Female 5. Click Continue 6. Click Ok 35 Unselected cases : Q2 = 2
  • 36. Sort and select cases 7. You will see a new variable: filter_$ (Variable view) 36
  • 37. Sort and select cases • Select cases – Example 2. Select cases who used any of cigarettes, alcohol, and marijuana during the last 30 days. 1. Data Select Cases 2. Click If button 3. Type Q30 > 1 | Q41 > 1 | Q47 > 1, click Continue 37
  • 38. Basic statistical analysis • Descriptive statistics – Purposes: 1.Find wrong entries 2.Have basic knowledge about the sample and targeted variables in a study 3.Summarize data Analyze Descriptive statistics Frequency 38
  • 41. 41 1. Skewness: a measure of the asymmetry of a distribution. The normal distribution is symmetric and has a skewness value of zero. Positive skewness: a long right tail. Negative skewness: a long left tail. Departure from symmetry : a skewness value more than twice its standard error. 2. Kurtosis: A measure of the extent to which observations cluster around a central point. For a normal distribution, the value of the kurtosis statistic is zero. Leptokurtic data values are more peaked, whereas platykurtic data values are flatter and more dispersed along the X axis. Normal Curve
  • 42. 42