Compute Function
(summary or total scores) Task: Using the Computer Function to
create a new summary variable (e.g. total scores) from a group of variables.
Start off by importing the
ex3reverse.sav into the Data Editor window of PASW / SPSS (from this
point forward referred to as simply SPSS). If you would like a more detailed
description of our example data and the fictional situation behind it, please
review (Module
4.3).
The compute function can be used to sum a series of variables such as items
of a subscale on a survey.
For the example below, we will be computing a total score for our 6 item
survey.
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 Total_Score in the "Target Variable:" box
which will be the name of our new variable. Then, type the equation in the
"Numeric Expression:" box, or you can move each variable oneatatime
and click the "+" button on the calculator pad with a space before and after
each "+" to construct the equation. Now just 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). Remember, it is often quicker to write
the syntax for simple compute functions than it is to navigate through and
pointandclick to complete the function. A review of the syntax from this
example (provided in the Log portion of your output) will show how simple it
would be to write such syntax.
That concludes using the Compute function to create a new variable as a sum or
total score of a combination of variables.
