Often you may want to **recode** the values of certain variables in SPSS.

For example, you may want to recode all “Yes” values to **1** and all “No” values to **0** for a certain variable.

The easiest way to recode variables in SPSS is to use **Transform** > **Recode into Same Variables**.

The following example shows how to do so in practice.

**Example: How to Recode Variables in SPSS**

Suppose we have the following dataset in SPSS that contains information about various basketball players:

Suppose that we would like to recode each **Yes** to 1 and each **No** to 0 in the **AllStar** column.

To do so, click the **Transform **tab, then click **Recode into Same Variables**:

**Note**: If you would rather create a new variable that contains these recoded values then you can instead click **Recode into Different Variables**.

In the new window that appears, drag the **AllStar** variable into the **String Variables** box:

Then click the **Old and New Values** button.

In the new window that appears, type **Yes** into the **Old Value** box and then type **1** into the **New Value** box, then click the **Add** button:

Then type **No **into the **Old Value** box and then type **0** into the **New Value** box, then click the **Add** button:

These two new recoding rules will be shown in the **Old –> New** box.

Lastly, click **Continue**. Then click **OK.**

The **Yes** and **No** values will now be shown as **1** and **0**, respectively, in the **AllStar** column:

Note that in this example we only recoded two values, but you can use this same process to recode as many values as you’d like for your own variables.

**Additional Resources**

The following tutorials explain how to perform other common operations in SPSS:

How to Identify Outliers in SPSS

How to Calculate Z-Scores in SPSS

How to Calculate Percentiles in SPSS