Applied Statistics-Ii
Applied Statistics-Ii
Introduction of SPSS
Irshad Ahmad
MS in Psychology
International Islamic University Islamabad
Recode
The Recode procedure is typically used with transformations involving categorical
variables.
It is the best option when you want:
A. To create a categorical distinction based on an existing numeric variable (such as a
median split)
B. To combine some of the categories in an existing categorical variable,
C. To change the values assigned to an existing categorical variable.
D. To categories a continuous variable.
For example, you may have measured people’s BMI (body mass index) as a continuous
variable but may want to use it to create groups such as underweight, normal,
overweight, obese.
Recode
Whenever you work with the Recode procedure you must choose whether to
recode Into Same Variables or to recode Into Different Variables.
If you choose to recode Into Same Variables then the result of your transformation
will replace the values of your original variable.
If you choose to recode Into Different Variables then the result of your
transformation will be placed into a new variable that you will have to name.
We suggest that you always use Into Different Variables so that you can later
choose to redo the transformation if you want
Recode single values in SPSS Statistics
You will have returned to the previous screen and will now have to click on the button.
This will take you to the Data View Editor, which will now show that you have created a new
variable that is based on recoding your existing variable:
Recode a given range in SPSS Statistics
Example: The data given below represents the scores of 10 students in a final
examination. Recode the data giving code "1" to scores between 75 - 100, code 2 to
scores between 61 - 74, code 3 to scores between 41 - 60 and code 4 to scores
between 0 - 40.
Enter the data in the SPSS Statistics Data Editor and name the variable "
Scores".
Remember that each individual's results go on a separate line (row) in SPSS
Statistics.
lick on Transform > Recode Into Different Variables... in the top
menu.
Transfer the variable you want to recode by selected it and pressing the
button,
and give the new variable a name and label. In this example, we have given the
new
variable a name of "NScores" and label of "New Scores" as shown below:
Click the Output variables are strings checkbox so that it will except values that are not
numbers. You need to increase the Width: from 8 to 16 also, so that the string labels
are not truncated.
Obtain the median of the variable as described in the section on Descriptive Statistics.
Choose Transform → Recode → Into different variables
Select the original continuous variable and click the arrow button.
Type the name of the new categorical variable in the box labeled Name.
Click the Change button.
Click the Old and New Values button.
Click the radio button next to Range: Lowest through.
Type the value of the median in the open box on the left side.
Type the value for the low category in the box labeled Value on the right side.
Click the Add button
Click the radio button next to All other values.
Type the value for the high category in the box labeled Value on the right side.
Click the Add button.
Click the Continue button.
Click the OK button.
To change the values of an existing categorical variable.
1 3
5
Recode
Step 3
3 4
Values after Recoding
Reverse coding
Questionnaires that use a Likert scale (eg. strongly disagree, disagree, neutral,
agree, strongly agree) for answering questions often contain some items which
are to be reverse scored.
Reverse coding is a procedure where some questions in a survey are worded
such that high values of a theoretical construct is reflected by high scores on the
item, while other questions are worded such that high values of the same
construct is reflected by low scores on the item.
Researchers do this to encourage respondents to actually pay attention to the
questions they are reading.
Unfortunately this means that you cant determine the overall score for the scale
simply by averaging the items.
Instead you must first transform the items so that they are all oriented in the
same direction.
Example
For example
All items might be scored such that
large values indicate more of the
construct. To do this, you would want
to reverse code the items where
small values indicated a greater
amount of the construct. So, if the
questions in the scale had values of 1
to 7, you would reverse code an item
by changing its values in the
following way:
Reverse coding Formula
While it would be possible to perform this transformation using the Recode procedure,
there is a simple formula you can use to do the same thing using the Compute
procedure.
In the current example, the scale minimum is 1 and the scale maximum is 7. Therefore,
the formula we need to use would be 8 – old value.
You can verify for yourself that this will produce the transformation described above.
The formula will work for any possible scale minima and maxima, even if the scale has
values less than zero.
Item score before Reverse Coding
Reverse coding
Step 1
Reverse coding
Step 2
3
Reverse coding
Step 3
3
1
2
5
Item Score after Reverse coding