Date: Sat, 5 Feb 2011 06:51:59 +0100 John F Hall "SPSSX(r) Discussion" John F Hall Re: Combine 2 dichotomous variables into 1 categorical 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

Â