Products | Versions |
---|---|
Spotfire Statistica | 13.2 and higher |
Lag(vref, offset, [default_value])
Returns value of variable vref in the current case less the offset. If the optional [default_value] parameter is given, it will be used for cases outside the valid range.
An example is given at below:
1. In the example data, variable "Var1" has 10 cases with integer number 1 to 10.
2. Double click "Var2" to access the variable dialog
3. Under Long name, enter the formula "=lag(var1,1,100)"
4. Click "OK" and then "Yes" to proceed.
5. "Var2" returns value of "Var1" in the current case number offset by 1 and 100 is set to be the value for case 1.