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;
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!