|Date: ||Tue, 18 May 2004 00:16:45 -0400|
|Reply-To: ||Richard Ristow <email@example.com>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Richard Ristow <firstname.lastname@example.org>|
|Subject: ||Re: Multiple response to single variable|
|Content-Type: ||text/plain; charset="us-ascii"; format=flowed|
At 01:58 PM 5/14/2004, Dan Buchanan wrote:
>I need to create a single variable based on the results of a multiple
>response question that has up to five columns/response fields. I want
>the new var to = 1 if the respondent selected item = 2, the new var to
>= 0 for all other values, and new sysmis = old sysmis.
Well, if you want NEWVAR to have value 1 if any of the responses have
value 2, it's very easy indeed. If the response variables are RESP1 to
RESP5, and are contiguous in the file,
COMPUTE NEWVAR = ANY(2,RESP1 TO RESP5).
(The other natural way to do this uses COUNT and RECODE.)
The problem is, wanting "new sysmis = old sysmis". It isn't clear what
should happen if some of RESP1 to RESP5 are missing, and others aren't.
The "ANY" logic will give
. 1 if any of RESP1 to RESP5 is 2, regardless of whether other values
are missing or not
. 0 of none of RESP1 to RESP5 is 2, but at least one is non-missing
. System-missing if *all* of RESP1 to RESP5 are missing.
Is that what you want? Or something else?