SlideShare a Scribd company logo
1 of 34
GAP Toolkit 5
Training in basic drug abuse data management
and analysis
Training session 7
SPSS: Recode and Compute
Objectives
• To introduce and demonstrate SPSS tools for recoding
variables and creating new variables
• To introduce and demonstrate the use of SPSS
command syntax
• To introduce and demonstrate Help features in SPSS
from a dialogue box
Types of recode
• A categorical variable into a new set of categories
• A continuous variable into a categorical variable
Recode approaches
• Into pre-defined categories of interest
• Into categories of equal size
Example: pre-defined categories
• Recode weekly expenditure on drugs into the following
categories:
– Low expenditure <= £100 a week
– High expenditure >= £101 a week
select variable for
recoding and click
click here to map
old  new values
Frequency Percent Valid
percent
Cumulative
percent
Valid Low 31 62.0 62.0 62.0
High 19 38.0 38.0 100.0
Total 50 100.0 100.0
Weekly drug expenditure
Example: quantiles
• Recode weekly expenditure into the following:
– 4 categories, each with approximately the same number of
cases (quartiles)
– 10 categories, each with approximately the same number of
cases (deciles)
Frequency Percent Valid percent Cumulative percent
Valid <=£90 12 24.0 24.0 24.0
£91 <= X <= £98 12 24.0 24.0 48.0
£99 <= X <= £105 13 26.0 26.0 74.0
£106 <= X >= £116 13 26.0 26.0 100.0
Total 50 100.0 100.0
NTILES of Expend
Frequency Percentage Valid percentage Cumulative
percentage
Valid 1 5 10.0 10.0 10.0
2 4 8.0 8.0 18.0
3 7 14.0 14.0 32.0
4 4 8.0 8.0 40.0
5 4 8.0 8.0 48.0
6 6 12.0 12.0 60.0
7 5 10.0 10.0 70.0
8 5 10.0 10.0 80.0
9 6 12.0 12.0 92.0
10 4 8.0 8.0 100.0
Total 50 100.0 100.0
NTILES of EXPEND
Compute
• Creates new variables using:
– Standard mathematical operators
– A full range of functions
– Conditional statements
Transform/Compute
click here to define variable type
Type and Label
Yexpend=Expend*52
Explore: Yexpend
Statistic Std. error
Yearly drug expenditure Mean 5062.72 77.468
95% Confidence Interval
for Mean
Lower Bound 4907.04
Upper Bound 5218.40
5% Trimmed Mean 5072.89
Median 5148.00
Variance 300062.3
Std. Deviation 547.779
Minimum 3848
Maximum 6032
Range 2184
Interquartile Range 754.00
Skewness -.333 .337
Kurtosis -.446 .662
Descriptives
Example 2: Age
• Convert date of birth to age in years
(DATE.DMY(01,01,2002) - dob) / (365.25*24*60*60)
Explore: Age
Statistic Std. error
AGE Mean 25.43 1.219
95% Confidence Interval
for Mean
Lower Bound 22.97
Upper Bound 27.88
5% Trimmed Mean 25.21
Median 22.84
Variance 72.867
Std. Deviation 8.536
Minimum 11
Maximum 44
Range 32
Interquartile Range 12.77
Skewness .579 .340
Kurtosis -.518 .668
Descriptives
Help
• Context-sensitive Help:
– Right click on any part of a dialogue box to obtain help
• Dialogue box Help button
Command language
• Command-line rather than Windows interface
• More flexible
• Reusable
• Saved as text files
Syntax window
• Enter SPSS commands:
– Type directly
– Paste from a dialogue box
• Run SPSS commands
• Save as a text file
The Paste button
click to copy command
into Syntax Window
The Run menu
Syntax for Age
Summary
• Recode:
– Into same variable
– Into different variable
• Compute:
– Mathematical operators
– Functions
• Dialogue box Help:
– Context-sensitive Help
– Dialogue box Help button
• Command language:
– Syntax Window
– Dialogue box Paste button

More Related Content

Similar to trs-7.ppt

QM-032-SQC tool application
QM-032-SQC tool applicationQM-032-SQC tool application
QM-032-SQC tool application
handbook
 
hspring07-085bk
hspring07-085bkhspring07-085bk
hspring07-085bk
Winter Liu
 
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docx
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docxRequired ResourceTextSchneider, A. (2017). Managerial Accounti.docx
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docx
audeleypearl
 
OL 325 Milestone Three Guidelines and Rubric Section
 OL 325 Milestone Three Guidelines and Rubric  Section OL 325 Milestone Three Guidelines and Rubric  Section
OL 325 Milestone Three Guidelines and Rubric Section
MoseStaton39
 
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docxWeek 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
jessiehampson
 
MATH 106 QUIZ 6NAME _____ _________________ Professor Dr. K.docx
MATH 106 QUIZ 6NAME _____ _________________  Professor Dr. K.docxMATH 106 QUIZ 6NAME _____ _________________  Professor Dr. K.docx
MATH 106 QUIZ 6NAME _____ _________________ Professor Dr. K.docx
andreecapon
 
Lecture 7 guidelines_and_assignment
Lecture 7 guidelines_and_assignmentLecture 7 guidelines_and_assignment
Lecture 7 guidelines_and_assignment
Daria Bogdanova
 

Similar to trs-7.ppt (20)

1030 track3 boire
1030 track3 boire1030 track3 boire
1030 track3 boire
 
1000 track2 boire
1000 track2 boire1000 track2 boire
1000 track2 boire
 
QM-032-SQC tool application
QM-032-SQC tool applicationQM-032-SQC tool application
QM-032-SQC tool application
 
hspring07-085bk
hspring07-085bkhspring07-085bk
hspring07-085bk
 
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docx
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docxRequired ResourceTextSchneider, A. (2017). Managerial Accounti.docx
Required ResourceTextSchneider, A. (2017). Managerial Accounti.docx
 
Capacity planning ppt @ bec doms
Capacity planning ppt @ bec domsCapacity planning ppt @ bec doms
Capacity planning ppt @ bec doms
 
OL 325 Milestone Three Guidelines and Rubric Section
 OL 325 Milestone Three Guidelines and Rubric  Section OL 325 Milestone Three Guidelines and Rubric  Section
OL 325 Milestone Three Guidelines and Rubric Section
 
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docxWeek 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
Week 2 Individual Assignment 2 Quantitative Analysis of Credit - .docx
 
Quotemonster roadshow session two June 2019
Quotemonster roadshow session two June 2019Quotemonster roadshow session two June 2019
Quotemonster roadshow session two June 2019
 
Research and Advicemonster Deep Dive - July 2019: Session Two
Research and Advicemonster Deep Dive - July 2019: Session TwoResearch and Advicemonster Deep Dive - July 2019: Session Two
Research and Advicemonster Deep Dive - July 2019: Session Two
 
Bayesian Approaches To Improve Sample Size Webinar
Bayesian Approaches To Improve Sample Size WebinarBayesian Approaches To Improve Sample Size Webinar
Bayesian Approaches To Improve Sample Size Webinar
 
Pharmacoeconomics - 2020_New.pptx
Pharmacoeconomics - 2020_New.pptxPharmacoeconomics - 2020_New.pptx
Pharmacoeconomics - 2020_New.pptx
 
MATH 106 QUIZ 6NAME _____ _________________ Professor Dr. K.docx
MATH 106 QUIZ 6NAME _____ _________________  Professor Dr. K.docxMATH 106 QUIZ 6NAME _____ _________________  Professor Dr. K.docx
MATH 106 QUIZ 6NAME _____ _________________ Professor Dr. K.docx
 
What Is Multilayer Perceptron Classifier And How Is It Used For Enterprise An...
What Is Multilayer Perceptron Classifier And How Is It Used For Enterprise An...What Is Multilayer Perceptron Classifier And How Is It Used For Enterprise An...
What Is Multilayer Perceptron Classifier And How Is It Used For Enterprise An...
 
Statistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptxStatistical Learning and Model Selection (1).pptx
Statistical Learning and Model Selection (1).pptx
 
Notes 3-6
Notes 3-6Notes 3-6
Notes 3-6
 
DA-Module 1.pptx
DA-Module 1.pptxDA-Module 1.pptx
DA-Module 1.pptx
 
Strategic approachppg v02
Strategic approachppg v02Strategic approachppg v02
Strategic approachppg v02
 
Lecture 7 guidelines_and_assignment
Lecture 7 guidelines_and_assignmentLecture 7 guidelines_and_assignment
Lecture 7 guidelines_and_assignment
 
Data Insight Leaders Summit Barcelona 2017
Data Insight Leaders Summit Barcelona 2017Data Insight Leaders Summit Barcelona 2017
Data Insight Leaders Summit Barcelona 2017
 

More from Gurumurthy B R

Lesson 3 American History - 1800 through the Civil War(1).pptx
Lesson 3 American History - 1800 through the Civil War(1).pptxLesson 3 American History - 1800 through the Civil War(1).pptx
Lesson 3 American History - 1800 through the Civil War(1).pptx
Gurumurthy B R
 
CPRReportLaunch-Presentation-Sweden-010914-2.pptx
CPRReportLaunch-Presentation-Sweden-010914-2.pptxCPRReportLaunch-Presentation-Sweden-010914-2.pptx
CPRReportLaunch-Presentation-Sweden-010914-2.pptx
Gurumurthy B R
 

More from Gurumurthy B R (20)

basic_rules.ppt
basic_rules.pptbasic_rules.ppt
basic_rules.ppt
 
3D_Printing.ppt
3D_Printing.ppt3D_Printing.ppt
3D_Printing.ppt
 
Gas Chromatography.ppt
Gas Chromatography.pptGas Chromatography.ppt
Gas Chromatography.ppt
 
damop_2005_gif.ppt
damop_2005_gif.pptdamop_2005_gif.ppt
damop_2005_gif.ppt
 
lecture3.pptx
lecture3.pptxlecture3.pptx
lecture3.pptx
 
vortrag070704.ppt
vortrag070704.pptvortrag070704.ppt
vortrag070704.ppt
 
verbrevs3.ppt
verbrevs3.pptverbrevs3.ppt
verbrevs3.ppt
 
American Revolutionppt.ppt
American Revolutionppt.pptAmerican Revolutionppt.ppt
American Revolutionppt.ppt
 
ZP394sample_ImmigrationPP.ppt
ZP394sample_ImmigrationPP.pptZP394sample_ImmigrationPP.ppt
ZP394sample_ImmigrationPP.ppt
 
Immigrants in America.ppt
Immigrants in America.pptImmigrants in America.ppt
Immigrants in America.ppt
 
Lesson 3 American History - 1800 through the Civil War(1).pptx
Lesson 3 American History - 1800 through the Civil War(1).pptxLesson 3 American History - 1800 through the Civil War(1).pptx
Lesson 3 American History - 1800 through the Civil War(1).pptx
 
سادسةHistory_of_USA.ppt
سادسةHistory_of_USA.pptسادسةHistory_of_USA.ppt
سادسةHistory_of_USA.ppt
 
SJSUIntroSocTischlerChap8PPT.ppt
SJSUIntroSocTischlerChap8PPT.pptSJSUIntroSocTischlerChap8PPT.ppt
SJSUIntroSocTischlerChap8PPT.ppt
 
23634.ppt
23634.ppt23634.ppt
23634.ppt
 
nash_session1_e.ppt
nash_session1_e.pptnash_session1_e.ppt
nash_session1_e.ppt
 
Chapter 9.ppt
Chapter 9.pptChapter 9.ppt
Chapter 9.ppt
 
GeographyReview29_3Poverty.pptx
GeographyReview29_3Poverty.pptxGeographyReview29_3Poverty.pptx
GeographyReview29_3Poverty.pptx
 
CPRReportLaunch-Presentation-Sweden-010914-2.pptx
CPRReportLaunch-Presentation-Sweden-010914-2.pptxCPRReportLaunch-Presentation-Sweden-010914-2.pptx
CPRReportLaunch-Presentation-Sweden-010914-2.pptx
 
03-12-13Child Poverty.ppt
03-12-13Child Poverty.ppt03-12-13Child Poverty.ppt
03-12-13Child Poverty.ppt
 
DOC 12A Gender_Poverty -ECLAC.ppt
DOC 12A Gender_Poverty -ECLAC.pptDOC 12A Gender_Poverty -ECLAC.ppt
DOC 12A Gender_Poverty -ECLAC.ppt
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

trs-7.ppt

  • 1. GAP Toolkit 5 Training in basic drug abuse data management and analysis Training session 7 SPSS: Recode and Compute
  • 2. Objectives • To introduce and demonstrate SPSS tools for recoding variables and creating new variables • To introduce and demonstrate the use of SPSS command syntax • To introduce and demonstrate Help features in SPSS from a dialogue box
  • 3. Types of recode • A categorical variable into a new set of categories • A continuous variable into a categorical variable
  • 4. Recode approaches • Into pre-defined categories of interest • Into categories of equal size
  • 5. Example: pre-defined categories • Recode weekly expenditure on drugs into the following categories: – Low expenditure <= £100 a week – High expenditure >= £101 a week
  • 6.
  • 8.
  • 9. click here to map old  new values
  • 10.
  • 11.
  • 12. Frequency Percent Valid percent Cumulative percent Valid Low 31 62.0 62.0 62.0 High 19 38.0 38.0 100.0 Total 50 100.0 100.0 Weekly drug expenditure
  • 13. Example: quantiles • Recode weekly expenditure into the following: – 4 categories, each with approximately the same number of cases (quartiles) – 10 categories, each with approximately the same number of cases (deciles)
  • 14.
  • 15. Frequency Percent Valid percent Cumulative percent Valid <=£90 12 24.0 24.0 24.0 £91 <= X <= £98 12 24.0 24.0 48.0 £99 <= X <= £105 13 26.0 26.0 74.0 £106 <= X >= £116 13 26.0 26.0 100.0 Total 50 100.0 100.0 NTILES of Expend
  • 16. Frequency Percentage Valid percentage Cumulative percentage Valid 1 5 10.0 10.0 10.0 2 4 8.0 8.0 18.0 3 7 14.0 14.0 32.0 4 4 8.0 8.0 40.0 5 4 8.0 8.0 48.0 6 6 12.0 12.0 60.0 7 5 10.0 10.0 70.0 8 5 10.0 10.0 80.0 9 6 12.0 12.0 92.0 10 4 8.0 8.0 100.0 Total 50 100.0 100.0 NTILES of EXPEND
  • 17. Compute • Creates new variables using: – Standard mathematical operators – A full range of functions – Conditional statements
  • 18. Transform/Compute click here to define variable type
  • 21. Explore: Yexpend Statistic Std. error Yearly drug expenditure Mean 5062.72 77.468 95% Confidence Interval for Mean Lower Bound 4907.04 Upper Bound 5218.40 5% Trimmed Mean 5072.89 Median 5148.00 Variance 300062.3 Std. Deviation 547.779 Minimum 3848 Maximum 6032 Range 2184 Interquartile Range 754.00 Skewness -.333 .337 Kurtosis -.446 .662 Descriptives
  • 22. Example 2: Age • Convert date of birth to age in years
  • 23. (DATE.DMY(01,01,2002) - dob) / (365.25*24*60*60)
  • 24. Explore: Age Statistic Std. error AGE Mean 25.43 1.219 95% Confidence Interval for Mean Lower Bound 22.97 Upper Bound 27.88 5% Trimmed Mean 25.21 Median 22.84 Variance 72.867 Std. Deviation 8.536 Minimum 11 Maximum 44 Range 32 Interquartile Range 12.77 Skewness .579 .340 Kurtosis -.518 .668 Descriptives
  • 25. Help • Context-sensitive Help: – Right click on any part of a dialogue box to obtain help • Dialogue box Help button
  • 26.
  • 27.
  • 28. Command language • Command-line rather than Windows interface • More flexible • Reusable • Saved as text files
  • 29. Syntax window • Enter SPSS commands: – Type directly – Paste from a dialogue box • Run SPSS commands • Save as a text file
  • 30. The Paste button click to copy command into Syntax Window
  • 31.
  • 34. Summary • Recode: – Into same variable – Into different variable • Compute: – Mathematical operators – Functions • Dialogue box Help: – Context-sensitive Help – Dialogue box Help button • Command language: – Syntax Window – Dialogue box Paste button