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
How would you define the end of a macro?
what are input dataset and output dataset options? : Sas programming
Mention common programming errors committed in sas ?
What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?
Which command is used to perform sorting in sas program?
explain about various caches available in data integrator? : Sas-di
Explain data_null_?
Differentiate between format and informat? : sas-grid-administration
What is the difference between %local and %global? : sas-macro
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
What is data _null_?
describe the interaction table in sas di? : Sas-di
How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro
how do the in= variables improve the capability of a merge? : Sas programming
what is the effect of the options statement errors=1? : Sas programming