As in the previous exercise the new variable already exists in the file distributed by the Open University. SPSS will not allow it to be overwritten, so yet again I had to overcome this by deleting the variable from the file and recreating it from scratch.
Click on Range and enter values 30[through]44: enter 2 in the Value box of the New Value panel
Click on Add
Finally tick Range through highest, enter 45: then enter 3 in the Value box of the New Value panel
and click on Add
and Continue Although this is only an exercise, the use of Lowest thru and thru Highest can be dangerous unless you are certain there are no non-missing values outside the valid range. A safer way would have been to use: 18 thru 29 --> 130 thru 44 --> 2, 45 thru 82 --> 3 and ELSE -- > SYSMIS.
Step 3: Adding in Value Labels
[CTRL]+End or scroll down to the new variable agegp3 (which will be appended at the end of the file) and click on the Values cell:
..then on the gray patch to bring up a new window, the Value Labels dialog panel:
Enter 1 in the Value box and 18-29 in the Value Label box
and click OK. The cell in the Values column in the Data Editor will now have changed:
[NB: I have not found a paste facility for this: is there one??] Again standard procedure would be to check the frequencies for the new variable: Pallant does not do it for this example. In general, it is better to check on initial frequencies for variables to be recoded, as there is always a risk of outliers and missing values being erroneously included in the recodes. Anyway: Analyse…
[NB: If you do this with drop-down menus, previous options and statistics are retained (because of the automaticEXECUTE and you will finish up with more output than you wanted! ie:]
which is clearly nonsense! As before syntax is quicker (from PASTE):
age (Lowest thru 29=1) (30 thru 44=2) (45 thru Highest=3) INTO agegp3 .