Date: Tue, 13 May 2003 09:32:48 -0400
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bob Walker <firstname.lastname@example.org>
Subject: Re: New Var from 3 vars
Content-type: text/plain; charset=us-ascii
Yes, a good upgrade, since ANY assigns a zero to non-matching values,
including system missing, so no need for a RECODE statement. Peter
should choose a variable name (8 chars or less) for use in syntax,
NEWVAR = ANY(16, VAR1 TO VAR3).
Surveys & Forecasts, LLC
2323 North Street
Fairfield, CT 06824-1738 USA
|From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf
|Sent: Tuesday, May 13, 2003 8:49 AM
|Subject: Re: New Var from 3 vars
|If you don't know about the "any" function, here's a tip for your bag
|compute SweetSixteen = any(16, var1, var2, var3).
|Unless I'm misunderstanding you, this should suffice...
|IF (VAR1 = 16 OR VAR2 = 16 OR VAR3 = 16) NEWVAR = 1.
|RECODE NEWVAR (1=1) (ELSE=0).
|Surveys & Forecasts, LLC
||From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf
||Sent: Monday, May 12, 2003 5:50 PM
||Subject: New Var from 3 vars
||The solution offered by Jim Marks to James Moffitt recently should
||enabled me to solve this, but I have not be able. So....
||If any of three existing vars has the value of 16, I would like to
||create a new var that would have value of "1" if 16 was present in
||one of the three, or "0" if absent.
||Thanks in advance.
||Peter J. Fagan, Ph.D.