Top Banner
GAP Toolkit 5 Training in basic drug abuse data management and analysis Training session 7 SPSS: Recode and Compute
34

GAP Toolkit 5 Training in basic drug abuse data management and analysis

Dec 31, 2015

Download

Documents

avram-baldwin

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 - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GAP Toolkit 5 Training in basic drug abuse data management and analysis

GAP Toolkit 5 Training in basic drug abuse data management and analysis

Training session 7

SPSS: Recode and Compute

Page 2: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 3: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Types of recode

• A categorical variable into a new set of categories• A continuous variable into a categorical variable

Page 4: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Recode approaches

• Into pre-defined categories of interest• Into categories of equal size

Page 5: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Example: pre-defined categories

• Recode weekly expenditure on drugs into the following categories:– Low expenditure <= £100 a week– High expenditure >= £101 a week

Page 6: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 7: GAP Toolkit 5 Training in basic drug abuse data management and analysis

select variable for recoding and click

Page 8: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 9: GAP Toolkit 5 Training in basic drug abuse data management and analysis

click here to map old new values

Page 10: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 11: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 12: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 13: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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)

Page 14: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 15: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 16: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 17: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Compute

• Creates new variables using:– Standard mathematical operators– A full range of functions– Conditional statements

Page 18: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Transform/Computeclick here to define variable type

Page 19: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Type and Label

Page 20: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Yexpend=Expend*52

Page 21: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 22: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Example 2: Age

• Convert date of birth to age in years

Page 23: GAP Toolkit 5 Training in basic drug abuse data management and analysis

(DATE.DMY(01,01,2002) - dob) / (365.25*24*60*60)

Page 24: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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

Page 25: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Help

• Context-sensitive Help:– Right click on any part of a dialogue box to obtain help

• Dialogue box Help button

Page 26: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 27: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 28: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Command language

• Command-line rather than Windows interface• More flexible• Reusable• Saved as text files

Page 29: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Syntax window

• Enter SPSS commands:– Type directly– Paste from a dialogue box

• Run SPSS commands• Save as a text file

Page 30: GAP Toolkit 5 Training in basic drug abuse data management and analysis

The Paste button

click to copy command into Syntax Window

Page 31: GAP Toolkit 5 Training in basic drug abuse data management and analysis
Page 32: GAP Toolkit 5 Training in basic drug abuse data management and analysis

The Run menu

Page 33: GAP Toolkit 5 Training in basic drug abuse data management and analysis

Syntax for Age

Page 34: GAP Toolkit 5 Training in basic drug abuse data management and analysis

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