# PSPP for Beginners: Recoding Variables

## How to recode variables into new variables

Data often comes in categories or groups that are important for understanding the dataset. PSPP has several features for making these categories or redoing existing categories. This recoding can be useful if we want to convert continuously scaled variables into groups or lump subgroups together into larger groups.

For this example let's pretend that a teacher wants to assign letter grades to the final grades at the end of the semester. This will involve applying percentage cutoffs like 90%, 80%, 70%, and so on to the total grade points earned throughout the semester. We will change the FinalGrade variable to a code that represents traditional letter grades such as A, B, C, D, and F.

Begin by selecting Recode Different from the Transform menu. Select the source variable containing the data that will be used to form the categories. Move this to the "old" part of the Variables field.

The next step is to set up a coding scheme. For this example, final grades of 180 to 200 (that is 90% and above) will be coded as 4 to represent an A grade. Click the "add" button to make it part of the recoding scheme. This process is repeated for other grade categories, such as 160 to 179 representing 3 for B grades. Note that there are a variety options, such as options for missing values and lowest through a particular value. Click on the "continue" button when the coding scheme is finished.

The last step is to give the output a variable name and a label. This one is called FinalGrade2 and the coding scheme is documented in the label. Click the "change" button to enter the new variable name into the old/new Variable field.

Clicking the "OK" button will create a new variable that has categories based upon the values in the original variable plus the coding scheme. Here's our example.

The FinalGrade and FinalGrade2 variables are shown side by side. The FinalGrade2 column has people coded as 2 = C, 3 = B, and 4 = A. These data are in ascending order because the data were sorted in a preceding step.

Home | Start | Variables | Data | Descriptive | Relationship | Inferential | Effect size | Advanced | Video

This work is licensed under a Creative Commons Attribution 4.0 International License that allows sharing, adapting, and remixing.