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 <johnfhall@orange.fr>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   John F Hall <johnfhall@orange.fr>
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

COMPUTE HIV_AIDS = HIV*10 + AIDS.

*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

www.surveyreearch.weebly.com

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 <http://spssx-discussion.1045642.n5.nabble.com/Combine-2-dichotomous-variabl es-into-1-categorical-tp3371471p3371542.html> Sent from the SPSSX Discussion mailing list archive <http://spssx-discussion.1045642.n5.nabble.com/> at Nabble.com.


[text/html]


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