Date: Sun, 13 Jan 2002 19:57:55 -0700
Reply-To: Carla Grayson <grayson@selway.umt.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Carla Grayson <grayson@selway.umt.edu>
Subject: recode problems
Content-Type: text/plain; charset=us-ascii
I'm having a problem with some recode syntax and am hoping that another
set of eyes can tell me where I've gone wrong.
I have three variables that many values (up to 40); they are called
emotion1 emotion2 emotion3. I want to create a new variable in which
everybody who received value 31 on any one of these three variables get
the value 1 and people who didn't use 31 at all. Some people get lost
during the recode. I believe the people who used 31 more than once are
getting dropped. Another downside of the way I've done this is that
people who had missing data to begin with get coded back in as 0.
The syntax I'm using is:
do if (emotion1=31) or (emotion2=31) or (emotion3=31).
compute temp=1.
end if.
recode temp (1=1) (else=0) into emot31.
I ran similar code for another dataset which I also think is not
producing the correct answer. In this case, I'm trying to create another
summary variable in which I want to know how many people scored above a
certain level on one of a number of variables. This can probably be
solved with the same syntax that would work for the first problem.
do if (calm>=4) or (happy>=4) or (fine>=4).
compute temp=1.
end if.
recode temp (1=1) (sysmis=0) into posemo.
Thanks!
Carla Grayson