On Tue, 23 Dec 2008 02:14:38 -0800, Yawen LI <
[hidden email]> wrote:
>Dear lister,
>
>Can anybody tell me how to write syntax to solve this problem?
>
>I want to replace the missing value of year 2004 with the value from year
>2006 X 90%.
>
>
>Thanks
>
>Yawen
>
>
Hi,
I think the following will do this, if I understand your question correctly.
* set up data
*--------------------------------------------------------------------.
DATA LIST FREE/ id(A3) yr2004 yr2006.
BEGIN DATA
001 250 275
002 275 320
003 . 100
004 . 200
END DATA.
* work out missing 2004 data - if 2004 is missing substitute 90 % of 2006 .
*------------------------------.
IF SYSMIS(yr2004) yr2004 = (yr2006 * .90).
EXE.
results in :
001 250.00 275.00
002 275.00 320.00
003 90.00 100.00
004 180.00 200.00
Clive.
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD