answered By vishnoiprem 0

Lag() function returns the value of the first previous observation in a time series. It could be used in Auto Regression analysis for time series.

For example, Let OBs be the cloumn name for the original time series, the analysis for AR(2) could be:

```
data test;
set test;
m = lag(OBS);
n = lag(m);
run;
proc reg data = test;
model y = m n;
run;
```

flag

Write A Tutorials

Question tags

Follow this question

Follow sas category

Question tags

sas
× 1

Asked
**2 years and 3 months ago ago**

Number of Views -280

Number of Answers -1

Last updated

**3 years and 2 months ago ago**

Number of Views -280

Number of Answers -1

Last updated