LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 5 Feb 2011 06:51:59 +0100
Reply-To:   John F Hall <>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   John F Hall <>
Subject:   Re: Combine 2 dichotomous variables into 1 categorical
In-Reply-To:   <AEA48BF3F6DC483FA333A2D818A94A8D@MJHP>
Content-Type:   multipart/alternative;

Another way is to multiply one variable by 10, add it to the other one and then use RECODE


*Should produce four values, 0,1,10, 11 .

recode hiv-aids (0=1) (10=2)(1=3)(11=4).

val lab hiv_aids

1 ‘Neither’ 2 ‘Aids only’ 3 ‘HIV only’ 4 ‘Both’ .

IF is an expensive procedure: COMPUTE with RECODE is quicker and cheaper. You still have a logical problem with your categories.

John Hall

From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of MaxJasper Sent: 04 February 2011 19:25 To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: Combine 2 dichotomous variables into 1 categorical

First decide to address the conflict of {(HIV=1) AND (AIDS=1)}?

Hello All,


I will probaby pose an elemental question, but at this moment I'm completely bugged out. I want to combine 2 dichotomous variables into 1 categorical, as follows:


HIV (0=No / 1=Yes)

AIDS (0=No / 1=Yes) INTO:



newvar name=HIV_AIDS, where 1 is HIV & 2 is AIDS


Thanks in advance! --


View this message in context: RE: Combine 2 dichotomous variables into 1 categorical < es-into-1-categorical-tp3371471p3371542.html> Sent from the SPSSX Discussion mailing list archive <> at


Back to: Top of message | Previous page | Main SPSSX-L page