can someone tell me how to write lagged variable in proc panel
I write
y= lag(X);
it does not work???????????
lag is not an option but, rather, a statement. e.g.,
LAG var( ... ) , ..., var( ... ) < / OUT= SAS-data-set > ;
You use it to create an output dataset that would then be analyzed with a separate call to proc panek,
Art, CEO, AnalystFinder.com
lag X1(1 3) X2(3 6 9) X3(2) / out=A_lag;
It's defined at: http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_panel_sect015....
Art, CEO, AnalystFinder.com
I see that
What does it mean
(1 3)
(3 6 9)
(2)
if you only want a lag of 1 for variable X you would use: lag x(1);
Art, CEO, AnalystFinder.com
RTM - the link was provided.
LAG var( ... ) , ..., var( ... ) < / OUT= SAS-data-set > ;
So the VAR indicates the variable that a lag will be created for, while the numbers in the parentheses indicate the lag that will be calculated ie
lag var1 (1 2 3) creates 3 lagged variables for a lag of 1, 2 and 3 periods respectively.
RTM to see how the variables are labeled or alternatives to the LAG function.
I write my program like that but it does not work
proc panel data= flux;
id rankdate rank_no;
model flux= lag estimate(1) / fixone noint HCCME=0 cluster;
ods output ParameterEstimates=res;
run;
lag is not an option but, rather, a statement. e.g.,
LAG var( ... ) , ..., var( ... ) < / OUT= SAS-data-set > ;
You use it to create an output dataset that would then be analyzed with a separate call to proc panek,
Art, CEO, AnalystFinder.com
can you please write for me an example of the statement
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.