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 (January 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Jan 2003 10:04:45 -0800
Reply-To:     D McGooey <darlene_mcgooey@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         D McGooey <darlene_mcgooey@HOTMAIL.COM>
Subject:      can I use the lag function to do this?
Content-Type: text/plain; charset=ISO-8859-1

I was reading some recent posts about the lag function, and I am confused. This is, conceptually what I want to try to do:

I have three variables: a(i...n), b(i...n) and c(i...n). For record 1, a=b=c. For the remaning records: a[i]=a[i], b[i]=a[i]*b[i-1], c[i]=a[i-1]*b[i-1]*c[i]. The problem is how do I access one element past for calculating the value b[i] and c[i]. I think the lag function could work, but the sas code is not working with me. There is very little documentation that I can find to explain it. Is this even possible in sas (well of course it is, but is it possible for ME in sas)?


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