Computing a New Variable |
|||
More on RECODE and COMPUTE Commands |
|||
It's time to stretch
your understanding of SPSS by elaborating on the
RECODE and COMPUTE commands, which you can use
to create your own variable from existing ones.
Consider this example: The citizen.sav
data has are seven separate variables
under the heading, Moral Values. For six
of the seven, respondents were scored 1 if they
said "yes" (e.g., believe in God) and 2 if they
said "no." For the last question on Sexual
Freedom, the scoring was somewhat different and
reversed in direction. Those who consistently
said "yes" to the first 6 questions and
"disagree" to the seventh might be called
"righteous" and those who consistently scored in
the opposite direction might be termed "Unholy"
-- with other response patterns
in-between. Suppose that you wanted
to learn how citizens in each country responded
to all seven questions, not just one. You
can use SPSS to create your own variable (let's
call it Unholy) by reversing the scoring
for the Sexual Freedom variable and then summing
the responses over all seven variables. Between
the GET FILE command and the CROSSTABS command,
insert a RECODE and a COMPUTE command as
follows: These commands will
produce the new variable Unholy. It will
range from 6 (least Unholy) to 13 (most Unholy).
Here is the CROSSTABS printout from that
run. Just make sure that you
combine the variables in sensible
ways.The computer has the capacity to transform
dumb mistakes into huge fiascos. Just be
thoughtful and careful in what you do.
|