|Functions and CALL Routines
Returns differences between an argument and its nth
specifies the number of lags.
specifies a numeric constant, variable,
The DIF functions, DIF1, DIF2, ..., DIF100,
return the first differences between the argument and its nth lag. DIF1 can also be written as DIF. DIFn is defined as
details on storing and returning values from the
LAGn queue, see the LAG function.
The function DIF2(X) is not equivalent
to the second difference DIF(DIF(X)).
This example demonstrates the difference between the
LAG and DIF functions.
input X @@;
1 2 6 4 7
proc print data=two;
Results of the PROC PRINT step follow:
OBS X Z D
1 1 . .
2 2 1 1
3 6 2 4
4 4 6 - 2
5 7 4 3
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.