```Date: Thu, 16 Jun 2011 14:38:26 +0200 Reply-To: John F Hall Sender: "SPSSX(r) Discussion" From: John F Hall Subject: Re: recode using multiple variables Comments: To: pmulonge In-Reply-To: <1308224744941-4494728.post@n5.nabble.com> Content-Type: text/plain; charset="us-ascii" Try something like: Count ones = M H F G (1) . Freq ones . Also have a look at the tutorials for COUNT and COMPUTE on my website John F Hall johnfhall@orange.fr www.surveyresearch.weebly.com -----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of pmulonge Sent: 16 June 2011 13:46 To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: recode using multiple variables Hello all, I hope you can really help me with this seemingly simple thing, for I am at my wits end. So I have four variables and I would like to add up all the cases that have value 1 for these variables. So did the following: RECODE M (1=1) (ELSE=SYSMIS) INTO ATL1. RECODE H (1=2) (ELSE=SYSMIS) INTO ATL1. RECODE F (1=3) (ELSE=SYSMIS) INTO ATL1. RECODE G (1=4) (ELSE=SYSMIS) INTO ATL1. Now when I run FREQ M H F G ATL1. There is deeply disturbing outcome: The values 1 thru 4 in ATL1 do NOT add up to the sum M=1, H=1, F=1, G=1. In fact, I noticed that in ATL1 the number of cases for value 1 is less than the number of cases for M=1 (in the M freq table). This is also true for ATL1 values 2, 3, 4, they are just less than value 1 for H F and G respectively. In essence, I just am loosing data when I try and sum the cases. Can anyone explain this to me or find an alternative syntax? I tried the syntax below, which gives the exact same disturbing result when I run the FREQs. COMPUTE NEW_VAR=ATL1D. IF (M=1) ATL1D=1. IF (H=1) ATL1D=1. IF (F=1) ATL1D=1. IF (G=1) ATL1D=1. FREQ ATL1D. P.S. Why am I doing all of this, well in the end I would like to find the union of the non-disjoint sets M H F G in my data and I have not been successfull thus far. ----- Pancho Mulongeni, Research Assistant Pharmaccess Foundation, Namibia -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/recode-using-multiple-variable s-tp1079099p4494728.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ```

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