Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "GAP Toolkit 5 Training in basic drug abuse data management and analysis Training session 7 SPSS: Recode and Compute."— Presentation transcript:

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

7 select variable for recoding and click

8

9 click here to map old  new values

10

11

12 FrequencyPercentValid percent Cumulative percent ValidLow High Total 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 FrequencyPercentValid percentCumulative percent Valid<=£ £91 <= X <= £ £99 <= X <= £ £106 = £ Total NTILES of Expend

16 FrequencyPercentageValid percentageCumulative percentage Valid Total 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

19 Type and Label

20 Yexpend=Expend*52

21 Explore: Yexpend StatisticStd. error Yearly drug expenditureMean % Confidence Interval for Mean Lower Bound Upper Bound % Trimmed Mean Median Variance Std. Deviation Minimum3848 Maximum6032 Range2184 Interquartile Range Skewness Kurtosis 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 StatisticStd. error AGEMean % Confidence Interval for Mean Lower Bound22.97 Upper Bound % Trimmed Mean25.21 Median22.84 Variance Std. Deviation8.536 Minimum11 Maximum44 Range32 Interquartile Range12.77 Skewness Kurtosis 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

32 The Run menu

33 Syntax for Age

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


Download ppt "GAP Toolkit 5 Training in basic drug abuse data management and analysis Training session 7 SPSS: Recode and Compute."

Similar presentations


Ads by Google