Date: Fri, 30 Apr 1999 10:04:10 GMT
Reply-To: David Booth <dkb@CIX.COMPULINK.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: David Booth <dkb@CIX.COMPULINK.CO.UK>
Organization: Compulink Information eXchange
Subject: Re: Simple Lag problem again
Peter Crawford notes:
> Or, if you are going to need all intermediate points between, say month
> 1 and month 60, then instead of using lagN functions, use the function
> mod(_n_,60) to identify the pointer into an array buffer of the last 60
>
> pointer = mod( _n_, depth );
> buffer{ pointer } = Y ;
>
> if _n_ < buffer then /* buffer not fully loaded */
>
...it's worth noting that the online help for Windows seems to suggest that
the maximum LAG depth is 100, so as well as maintaining intermediate values,
Peter's method also offers the possibility of working with much larger
depths.
TIP: Don't believe the online help - I've got a LAG100001 working correctly
here!
Dave
.
|