BEGIN PROGRAM PYTHON. import spss dataset = spss.Dataset() for var in dataset.varlist: print(var.name) END PROGRAM.
Transforming variables is where SPSS syntax shines over the manual user interface.
Recode region. RECODE region_id (1=1) (2,3=2) (4 thru 6=3) INTO region_cat. VALUE LABELS region_cat 1 'North' 2 'Central' 3 'South'.
Note: The EXECUTE. command tells SPSS to read the data and run the preceding transformations. 2. Variable Definition and Labeling
COMPUTE age_group = 0. IF (age >= 18 AND age <= 24) age_group = 1. IF (age >= 25 AND age <= 34) age_group = 2.



