WHAT IS LAG FUNCTION ? WHERE CAN YOU IMPLEMENT THIS
FUNCTION?

Answer Posted / zyin2

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 y be the cloumn name for the original time
series, the analysis for AR(2) could be:

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

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is data governance? : Sas-di

631


For what purpose would you use the RETAIN statement?

1057


what are some differences between proc summary and proc means? : Sas programming

515


If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?

712


Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?

1478






What is the difference between where and if statement?

630


What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?

693


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4625


how sas deals with business intelligence? : Sas-bi

591


what are the considerations when picking a SAS/STAT procedure?

2910


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

649


what do the pad and dim functions do? : Sas programming

574


Tell e how how dealt with..

1767


for report generation which one you used proc report or data_null_?

6617


What is maximum number of rows and cols can be handled in SAS?

864