Date: Thu, 31 Oct 2002 16:54:04 -0600
Reply-To: "Peck, Jon" <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Peck, Jon" <firstname.lastname@example.org>
Subject: Re: Why does (missing value) multiplied by zero = zero?
Content-Type: text/plain; charset="iso-8859-1"
The SPSS Syntax Reference explains what is happening here...
Some arithmetic operations involving 0 can be evaluated even when the variables have missing values. These operations are
0*missing = 0
0/missing = 0
mod(0,missing) = 0
You can use the SYSMIS() or MISSING() functions in an expression to achieve different results.
From: Andrew Fenyo [mailto:A.J.Fenyo@ukc.ac.uk]
Sent: Thursday, October 31, 2002 11:27 AM
Subject: [SPSSX-L] Why does (missing value) multiplied by zero = zero?
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
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.
MISSING VALUES Q (9999).
MISSING VALUES ATYPE BTYPE (0).
DO IF MISSING (Q).
MISSING VALUES QA QB (-9).
Andrew Fenyo, Senior Computing Officer
Personal Social Services Research Unit
University of Kent, Canterbury, CT2 7NF
Voice: 01227 827610 Fax: 01227 827038