Skip to Main Content

Manipulate/transform data

What transformations can be conducted

You may need to transform your data so that you can conduct specific analyses, including:

  • calculating total scale scores
  • collapsing a numeric variable into groups
  • recoding variables

Calculating total scale scores

  1. Reverse negatively worded items.  

a.  Click on Transform\Recode into Different Variables.

b.  Select the items you want to reverse and move them to the Input variable-Output variable box.

c.  Give the first variable a new name in the Output variable section (usually start with R to indicate ‘reversed’).

d.  Click on the old and new values button to indicate how values are reversed (e.g. 5=1).

 

Recode into different variables: Old and new values dialog box

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation. SPSS Inc. was acquired by IBM in October, 2009.

2. Add up total scores

a.  Click on Transform\Compute Variable.

b.  Write the name of the new variable in the ‘Target Variable’ box (you can add T as a prefix to indicate ‘total’).

c.  Write a new label under the Type & Label button.

d.  Select the items of the scale (e.g. op1,op2, rop3,…) and move them into the Numeric Expression box.

e.  Add + using the calculator and divide by the number of items (e.g. op1+op2+rop3).

 

Computer variable dialog box

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation. SPSS Inc. was acquired by IBM in October, 2009.

Collapsing a numeric variable into groups

One method to create groups from a numeric variable is Visual Binning. This procedure will divide your sample into groups (e.g. three age groups).

  1. Click on Transform\Visual Binning
  2. Move the variable to recode to the Variables to Bin box
  3. In the section Binned Variable, type the name of the new categorical variable you will create
  4. Click on Make Cutpoints and Equal Percentiles Based on Scanned cases. In the Number of Cutpoints section, specify a number that is one less than the number of groups that you want
  5. Click on make Labels to automatically generate value labels for each newly created group

Recoding variables

Use the Transform\Recode into different variables to recode a variable. It is recommended that you keep the original and the recoded variable (i.e. use Recode into different variables to keep both variables).

For example, you may want to recode the variable 'Educational level' (1= primary, 2= secondary, 3= bachelor; 4= masters; 5= PhD) into three groups: non-tertiary (1), undergraduate (2), and postgraduate (3). In this example, 1 and 2 would be recoded as 1; 3 as 2; and 4 and 5 as 3.