LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 31 Oct 2002 17:26:34 -0000
Reply-To:     Andrew Fenyo <A.J.Fenyo@ukc.ac.uk>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Andrew Fenyo <A.J.Fenyo@ukc.ac.uk>
Subject:      Why does (missing value) multiplied by zero = zero?
In-Reply-To:  <JAEFJAPAEBFCDIHJIFKCKEKGCHAA.rlevesque@videotron.ca>
Content-Type: text/plain; charset="iso-8859-1"

Folks,

I have been tearing my hair out, but I cannot see what I am doing wrong!

I have a variable Q and a category TYPE. I need to create two new variables (QA and QB) which take the value of Q or MISSING depending on TYPE. It works fine EXCEPT when Q is zero: then I get both QA and QB set to zero.

I have probably overlooked something very simple, but any suggestions would be most welcome.

Here is a sample and the syntax:

DATA LIST LIST /TYPE Q. BEGIN DATA 1 25 1 2 1 0 1 6 1 17 2 6 2 26 2 9999 2 0 2 18 END DATA. LIST. MISSING VALUES Q (9999). COMPUTE ATYPE=2-TYPE. COMPUTE BTYPE=1-ATYPE. MISSING VALUES ATYPE BTYPE (0). LIST. DO IF MISSING (Q). COMPUTE QA=-9. COMPUTE QB=-9. ELSE. COMPUTE QA=Q*ATYPE. COMPUTE QB=Q*BTYPE. END IF. MISSING VALUES QA QB (-9). LIST.

============================== Andrew Fenyo, Senior Computing Officer Personal Social Services Research Unit University of Kent, Canterbury, CT2 7NF Voice: 01227 827610 Fax: 01227 827038 PSSRU: http://www.ukc.ac.uk/PSSRU


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