Modifying SPSS data

Steve Simon

1999-09-18

This page is currently being updated from the earlier version of my website. Sorry that it is not yet fully available.

*Dear Professor Mean

Dear Impatient

You should really be more patient. The best strategy is to compute all of your statistics and then change the data if you don’t like what you see.

No

Select the COMPUTE submenu if you want to modify a continuous variable. Converting to a different unit of measurement is one example. You would also use COMPUTE if you wanted to calculate a ratio of two variables.

Select the RECODE submenu if you want to modify a categorical variable. Combining some of the category levels is one example. Also use RECODE if you want to renumber your category levels.

More details

**To convert a continuous variable

For example

Be sure that you know the range of possible values for any variables that you transform. If you define a formula with division and some of your denominators are zero

**To convert a categorical variable

When you select TRANSFORM | RECODE you have the choice of recoding INTO SAME VARIABLES or INTO DIFFERENT VARIABLES. The folks who like to go bungee jumping without checking the length of the bungee cord usually select the first option. **Unless you want to make permanent and irreversible changes to your data set

Also you should plan for how you want missing values to be handled. Sometimes you might want to convert missing values into a special category or you might want to convert a special category to missing. You can choose instead to work with missing values when you document your variables (by selecting DATA | DEFINE VARIABLE from the menu or by double clicking on column heading).

Example

In a study of breast feeding

We would select TRANSFORM | COMPUTE from the menu and fill in the dialog box as shown above. We could then click on the TYPE&LABEL button if we wanted to add documentation for this new variable.

Another variable in this data set is breast feeding status at discharge. This is a categorical variable with four levels

We would start by selecting TRANSFORM | RECODE from the menu. In the first dialog box

Then we would click on the OLD AND NEW VALUES button to define what categories we want to recode. The value of 1 (exclusive) will stay the same

Summary

You can find modifications for SPSS data under the TRANSFORM menu. Select the COMPUTE submenu if you want to modify a continuous variable. Select the RECODE submenu if you want to modify a categorical variable.

You can find an earlier version of this page on my original website.