How do I replace missing values with zero in SPSS?

To replace missing values with zero in SPSS, follow these steps:
1. Open your dataset in SPSS.
2. Click on the “Transform” menu and select “Replace Missing Values.”
3. In the new window, select the variables for which you want to replace missing values with zero.
4. Under the “Replacement” tab, select “User-defined” and enter “0” in the blank field.
5. Click “Add” and then “Continue” to confirm the replacement.
6. Finally, click “OK” to apply the changes to your dataset. This will replace all missing values with zero in the selected variables.

Replace Missing Values with Zero in SPSS


Often you may want to replace missing values with zero in SPSS.

The easiest way to do this is by using Transform > Recode into Same Variables.

The following example shows how to do so in practice.

Example: How to Replace Missing Values with Zero in SPSS

Suppose we have the following dataset in SPSS that contains information about exam scores received by various students in some class:

Notice that there are several missing values in the Exam_Score column.

Suppose that we would like to replace each of these missing values with zeros.

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

In the new window that appears, drag the Exam_Score variable into the Numeric Variables box:

Then click the Old and New Values button.

In the new window that appears, click the button next to System-missing under OId Value and then type 1 into the New Value box, then click the Add button:

SPSS replace missing values with zero

This new recoding rule will be shown in the Old –> New box.

Lastly, click Continue. Then click OK.

Note that in this example we only replaced missing values with zero in one column, but you can use this same process to replace missing values in as many columns as you’d like.

Additional Resources

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

x