0% found this document useful (0 votes)
22 views42 pages

Applied Statistics-Ii

Uploaded by

Abdul Majid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views42 pages

Applied Statistics-Ii

Uploaded by

Abdul Majid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

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

Example: The data given below represents runs scored by 5 batsmen in a


national-level match. Recode the data so that the batsmen are rank ordered by
their number of runs, with the batsman with the highest runs given a code of "1"
and the batsman with the lowest runs given a "5".
Enter the data in the SPSS Statistics Data Editor and name the variable "Runs"
.
Remember that each individual's results go on a separate line (row) in SPSS
Statistics.
Click on Transform > Recode Into Different Variables... in the top menu.
You need to highlight the Runs variable in the left-hand box by clicking on it and then
click the button to move it across to the Numeric Variable -> Output Variable: box.
In the –Output Variable– area show below, give the new variable you are
about to create a name and label. In this example, we have named the
new variable "Ranked-Runs" and the label as "Ranked Runs" (see the
).

Click on the button.


You should now see that the Numeric Variable -> Output Variable:
box has now changed to reflect these changes (see the
).

Click on the button.


Enter the first score (120) into the Value: box within the –Old Value– area,
and set the new code of "1" into Value: box within the –New Value– area.
Click on the button.
Repeat for all other values, such that you are presented with the
following screen:

Click on the button.

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 on the button.

Click on the button.


Enter the first range of "75 - 100" into the Range: box within the –
Old Value– area, and set the new code to "1" into the Value: box
within the –New Value– area, as shown below:

Click on the button.


Repeat for all other values, such that you are presented
with the following screen:

Click on the button.


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:
Recoding data into two categories
Example: The data given below represents a satisfaction rating out of 10
for a new service offered by a company. The company would like to code
all those who responded by giving ratings above 5 a "Satisfactory" code
and those below 5 a "Dissatisfactory" code.
Enter the data in the SPSS Statistics Data Editor and name the variable "
Ratings".
Remember that each individual's results go on a separate line (row) in SPSS
Statistics.
Click on Transform > Recode Into Different Variable... 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 "NRatings" and label of "New Ratings" as shown
below:

Click on the button.

Click on the button.


Enter the value of "5" into the Range, LOWEST through value: box within the –Old
Value– area, and set the new code to "1" into the Value: box within the –New Value–
area.

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.

Click on the button.


Click on the button.
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:
To perform a median split

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.

 Choose Transform → Recode → Into different variables


 Select the original categorical 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.
 You must tell SPSS how the values of the old categorical variable map onto the
values of the new variable. For each level of the old variable
 Make sure the radio button next to Value is selected.
 Type the value of the original variable in the open box on the left side.
 Type the corresponding value of the new variable in the box labeled Value on the
right side. Its perfectly acceptable to assign the same new value to several
different old values.
 Click the Add button.
 Click the Continue button.
 Click the OK button.
Values before Recoding
Recode
Step 1
Recode
Step 2

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

In a self-esteem questionnaire we may have some positively worded questions


For example: I take a positive attitude toward myself
but also some negatively worded questions
For example: At times, I think I am no good at all
In the above example, we might attribute an answer of strongly disagree with a score of
1, disagree = 2, neutral =3, agree = 4 and strongly agree =5 for each question.
This would be fine for the positively worded questions, as this would give people with
high self-esteem a high score, however, we can’t use the same scoring for the negatively
worded questions. Instead what we do is reverse score the negatively worded
questions.
Reverse scoring means that the numerical scoring scale runs in the opposite direction.
So, in the above example strongly disagree would attract a score of 5, disagree would
be 4, neutral still equals 3, agree becomes 2 and strongly agree = 1.
Example: Look at the following items
1) I get stressed out easily. (stress#)
2) I am relaxed most of the time. (relax#)
3) I worry about things. (worry#)
4) I seldom feel blue. (notblue#)
5) I am easily disturbed. (disturb#)
6) I get upset easily. (upset#)
7) I change my mood a lot. (mood#)
8) I have frequent mood swings. (swings#)
9) I get irritated easily. (irritat#)
10)I often feel blue. (blue#)
Most of these items indicate that the person is easily upset or stressed out. This is referred to as
Neuroticism.
Two of these items, the second and fourth items, refer to the opposite. We need to recode these
two items, so that higher scores indicate higher levels of Neuroticism on all ten items.
Reverse coding (cont…)

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.

The formula is:

new value = (scale minimum + scale maximum) – old value

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

You might also like