http://uit.unt.edu/research

Data Science and Analytics

UITHelp Desk | Training | About Us | Publications | DSA Home

Please participate in the DSA Client Feedback Survey.

Return to the SPSS Short Course

MODULE 5

Compute Function (recoding)

Task: Using the Computer Function to recode a reverse coded item.

Start off by importing the ex3reverse.sav into the Data Editor window of PASW / SPSS (from this point forward referred to as simply SPSS).

The compute function can be used to recode a Likert scale item which was initial reverse coded by the wording of its stem or statement. The keys to using compute to recode an item are two simple formulas. The general idea is that we add 1 to the number of possible response choices, creating a constant, and then subtract the old value from that constant.

Formula (1): k + 1 = C

where k equals the number of  possible Likert response choices and C equals the Constant we will apply in the compute function.

Formula (2): C - O = RC

where C equals the Constant from the previous equation, O equals the old variable values, and RC equals the newly recoded variable values.

For instance, our current example uses a 5-point Likert response format. Since we want to reverse the numeric coding in our data file, we add 1 to 5 and get 6 as our constant.

(1): 5 + 1 = 6

We then subtract each person's response on the old variable from 6 and the result will be each person's recoded response.

(2): 6 - q4 = q4_RC

For the example below, we will be recoding question 4 (q4) as was done using the Recode function in a previous module (Module 4.3). If you would like a more detailed description of our example data and the fictional situation behind it, please review that module.

To use the Compute function, simply go to "Transform", "Compute Variable..."

You should now see the "Compute Variable" dialog box.

In the Compute dialog, first type q4_RC in the "Target Variable:" box which will be the name of our new variable. Then, type our constant (C) of 6 in the "Numeric Expression:" box, followed by a space, then a minus sign, then a space. Next, highlight and move q4 from the available variables box to the "Numeric Expression:" box using the arrow. Now click on "OK" or "Paste" if you would prefer a syntax record be created (from which you can highlight and submit the syntax to perform the compute/recode).

That concludes using the Compute function to recode an item.

Return to the SPSS Short Course

UNT home page

Contact Information

Jon Starkweather, PhD

Jonathan.Starkweather@unt.edu 940-565-4066

Richard Herrington, PhD

Richard.Herrington@unt.edu

940-565-2140

Please participate in the DSA Client Feedback Survey.

Last updated: 2018.11.12 by Jon Starkweather.

UITHelp Desk | Training | About Us | Publications | DSA Home