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 (November 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Nov 2004 20:41:25 -0800
Reply-To:     Jason Zhang <qiyuzhang2@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:     DomainKeys? See http://antispam.yahoo.com/domainkeys
From:         Jason Zhang <qiyuzhang2@YAHOO.COM>
Subject:      lag1() question
Content-Type: text/plain; charset=us-ascii

Hi,

I want to generate a value for a variable, say t. But tĄ¯s value depends on previous observationĄ¯s t value. I used the code: T=lag1(t)*0.8;

It doesnĄ¯t work. The following is an example of what I want to do: data one; input x; cards; 1 2 3 4 5 6 ; run;

data two; set one; if _n_=1 then t=1; else t=lag1(t)*0.8; run;

what I expected for tĄ¯s values are: 1 0.8 0.64 Ą­

Can anyone help me with this? Thanks a lot!!! Jason

__________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com


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