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
5. Example: pre-defined categories
• Recode weekly expenditure on drugs into the following
categories:
– Low expenditure <= £100 a week
– High expenditure >= £101 a week
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)
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
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