SHAZAM Community
Ask Your Question

Revision history [back]

You could do

GENR LAGX = LAG(X) GENR DIFFX = X-LAGX

Note that the Lag of X doesn't exist for the first observation so a WARNING is printed.

You could do

GENR LAGX = LAG(X)
GENR DIFFX = X-LAGX

X-LAGX

Note that the Lag of X doesn't exist for the first observation so a WARNING is printed.