Example of Lag function in Statistica

Example of Lag function in Statistica

book

Article ID: KB0074206

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.2 and higher

Description

This article introduces Lag function in Statistica spreadsheet.

Issue/Introduction

Example of Lag function in Statistica

Environment

Windows

Resolution

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.