Hey all, I had simulation data with 500 column as replication data, and 1500 rows as number of sample size in a excel file.
I wish to ask how do i need to do it in loop which ask sas to read the first column then carry on the proc arima and get the AIC, then loop with second column and so on...
and wish to have all the AIC values in a dataset
Can some one please help me on this?
I'm not an expert on PROC TIMESERIES but you can list multiple variables in the VAR statement.
There is also this, scroll down to the section "The BY way for many models", which talks about PROC REG but the exact same method using a BY statement should work for PROC TIMESERIES and/or PROC ARIMA
https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html
Hello,
This is the dumbest and slowest way of doing it.
Let us know if you need something more performant, more concise and more smart!
data abc;
set sashelp.pricedata;
where region=3;
where also line=4;
where also product=13;
run;
PROC SQL noprint;
create table varnamesarima as
select *
from dictionary.columns
where libname='WORK' and memname='ABC'
and type='num' and name NOT IN ('date','cost','region','line','product');
QUIT;
data _NULL_;
if 0 then set varnamesarima nobs=count;
call symputx('numbervars',put(count,12.));
STOP;
run;
%PUT &=numbervars;
%MACRO DO_BRANCH;
%do i=1 %to &numbervars;
data _NULL_;
set varnamesarima(firstobs=&i. obs=&i.);
call symputx('currentvar',name);
run;
%PUT §§§§§§§§§§ CURRENT VAR §§§§§§§§§§;
%PUT &=currentvar;
%PUT §§§§§§§§§§ CURRENT VAR §§§§§§§§§§;
proc timeseries data=Work.abc seasonality=12 plots=(series corr);
id date interval=month;
var ¤tvar. / accumulate=none transform=none dif=0 sdif=0;
run;
proc arima data=Work.abc;
identify var=¤tvar.; run;
/*** for multiplicative SARIMA model ***/
estimate q=(1) p=(1)(12) noconstant method=ml; run;
QUIT;
%end;
%MEND DO_BRANCH;
%DO_BRANCH
QUIT;
/* end of program */
Koen
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.