Use the LAG operator to access elements in the previous row.
DATA LIST FREE / V1 to V5.
BEGIN DATA
1 2 3 4 5
4 5 6 7 8
7 8 9 0 1
END DATA.
COMPUTE V5_2 = V4 - V3.
COMPUTE V4_2 = LAG(V5) + V2.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more