Date: Thu, 26 Jul 2001 19:49:03 -0400
Reply-To: Jeff A <jma157remove_this@PSU.EDU>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Jeff A <jma157remove_this@PSU.EDU>
Subject: Re: Missing values in computes
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 04:07 PM 7/26/2001 -0700, you wrote:
>Hi,
>
>I suspect this will be simple for someone.....
>
>I've got the following syntax:
>
>MISSING VALUES Q46_6B Q46_7CB (-9.00).
>COMPUTE mw3_exwt = 999.
>If (Q46_6B ge Q46_7CB) mw3_exwt = Q46_6B*6.5.
>If (Q46_6B lt Q46_7CB) mw3_exwt = Q46_7CB*3.5.
>
>Here are some of the results:
>
> Q46_6B Q46_7CB MW3_EXWT
> 2.00 . 999.00
> 4.00 -9.00 999.00
> . . 999.00
> 3.00 -9.00 999.00
> -9.00 -9.00 999.00
> 4.00 7.00 24.50
>
>How do i say: "If one of the variables is a missing value then use the value
>of the other variable"?
Something like this should work.
if (sysmis(Q46_6B)) Q46_6B = Q46_7CB .
if (sysmis(Q46_7CB )) Q46_7CB = Q46_6B .
Alternatively, use something like this if it isn't system-missing.
if (missing(curr_age)) curr_age = 32.
Jeff
(fix address to reply directly)