Data - Recode

Ribbon bar. Select the Data tab. In the Transformations group, click Recode to display the Recode Values of Variable dialog box.

Classic menus. From the Data menu, select Recode to display the Recode Values of Variable dialog box.

Use these options to recode the cases in the variable.

Up to 16 categories can be used to recode a variable. To specify a recode category, first select Include cases, Include If, Exclude Cases, or Exclude If from the drop-down box and then enter the case number(s)/recode condition in the field below the drop-down box. For details on the syntax you can use in recode conditions, see What syntax can be used to create case selection/verification/recode conditions.

When you select Include cases, the case number (or range of case numbers) that you enter is replaced with the New Value (see below). Exclude cases will replace the original values for cases (observations) that are not included in the case number (or range of case numbers) with the New Value. When you select Include if and the recode condition you enter evaluates to true, the original values of the recoded variable for cases (observations) meeting the condition are replaced with the New Value. Exclude if assigns the New Value to the original values for cases (observations) that do not meet the specified recode condition.

In the New Value group, specify the value to replace the original value(s). You can choose either a specific text or numeric value (select the value option button) or the missing data value (select the MD code option button) as the new value.

If no conditions are met by a case (observation) when the variable is recoded, use the Other group to either set the original value of that case to the missing data value (select the MD code option button), a specific text or numeric value (select the value option button), or leave it as the original value (select the unchanged option button).

Recode conditions can be saved for future use by clicking the Save As button. Previously saved multiple case selection conditions can be opened and used as recode conditions by clicking the Open button.