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
**1 year and 1 month ago ago**

Number of Views -156

Number of Answers -1

Last updated

**2 years and 1 month ago ago**

Number of Views -156

Number of Answers -1

Last updated