Date: Thu, 31 Oct 2002 18:28:06 -0500
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Arthur J. Kendall" <Arthur.Kendall@VERIZON.NET>
Subject: Re: Why does (missing value) multiplied by zero = zero?
Content-Type: text/plain; charset=us-ascii; format=flowed
I assume you are talking about the 3rd and 9th lines
anything * zero = zero
also note that you will get different results if you put an
execute.
before declaring missing values for atype and btype.
Hope this helps.
Art
Art@DrKendall.org
Social Research Consultants
University Park, MD USA
Andrew Fenyo wrote:
>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
>
>
>
|