LAG
Applies to PredictiveInsight only.
Syntax
LAG(lag, data)
Parameters
lag
The number of time steps to lag. This value must be a positive integer.
data
The values to lag. This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® product.
Description
LAG returns values in the input data range, lagging by the specified number of time steps. It views each input column as a data series in time. and returns one new column for each input column. Each new column contains the time step-lagged values (lagging by lag number of time steps) of the numbers in the corresponding input column. The first lag values in the returned column(s) are zero. The length of the returned column(s) are the lengths of in the corresponding input column(s) + lag.
*
The LAG macro function returns a column with values such that the cell VY[x ] = data[x - lag] for x ? lag, else 0.
Examples
Creates a new column named TEMP containing the values 0, 1, 2, 3, and 4 in cells 1-5, respectively.
Creates a new column named TEMP, where each value is the contents of column V1 lagging by two time steps.
Creates three new columns named TEMP, VX, and VY. The values in the TEMP column are the contents of column V1 lagging by ten time steps, the values of the VX column are the contents of column V2 lagging by ten time steps, and the values of the VY column are the contents of column V3 lagging by ten time steps.
Creates a new column named TEMP, where the first 5 cells contain 0, followed by rows 10-20 of column V1. The other cells in TEMP are empty.
Creates two new columns named TEMP and VX, each with values in rows 1-7 (the other cells are empty). The values in rows 1-2 of each column are zeros. The remaining values in TEMP are the values in rows 1-5 of column V1. The remaining values in column VX are rows 1-5 of column V2.
Related Functions