BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Marc1123
Fluorite | Level 6

Hello,

 

I'm doing simulations on detecting seasonality using proc x12 statement, i want to get Fs stat that is behind D8A#1 output. All the stats provided are very nice, but I need to get many, many, I mean many Fs stats. It actually takes too long for proc x12 statement to give me the results, so I wonder if it is possible to get SAS running only on Fs stats and not loosing time in all other tables calculation : it needs only table B1, B2 and B3 to get Fs. Any suggestions other than to code manually the process to get my results faster? Because it is already done, but I want as fast as possible, I'm more statistician than programmer 😞 

 

That's the basic code for PROC X12 provided as exemple from SAS support. 

ods output D8A#1=SalesD8A_1;
ods output D8A#2=SalesD8A_2;
ods output D8A#3=SalesD8A_3;
ods output D8A#4=SalesD8A_4;
proc x12 data=sales date=date;
   var sales;
   transform power=0;
   arima model=( (0,1,1)(0,1,1) );
   estimate;
   x11;
run;

Also, on the side, another little question :

 

Stat M7 is :

                             sqrt(0.5* (7/Fs + 3*Fm/Fs) )

 

Is someone knows where the 7 come from? Is it the same 7 as general critical value to reject H0 for Fs that is many times used? We also want 7/Fs smaller than 1 to detect present combined seasonality, that's what's making me thinking that way. Any information on that 7 will be very welcome!!

 

Thank you all, and happy coding!

 

Marc

 

Ps : sorry for my english ahah not perfect!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

There is also an OUTPUT statement in PROC X11 in addition to the OUTSTAT option.

 

If you are doing repetitive calls you might also look into use BY group processing to run all of the variations with one PROC call.

See this article https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html

 

View solution in original post

9 REPLIES 9
Reeza
Super User

Does that code work at all? I wouldn't expect to see the # sign in working code. 

 

One way to speed things up is to turn off all output and only capture the output you need to tables, using ODS SELECT. Usually most of the time is generating the displayed output, not in the calculations/process.


@Marc1123 wrote:

Hello,

 

I'm doing simulations on detecting seasonality using proc x12 statement, i want to get Fs stat that is behind D8A#1 output. All the stats provided are very nice, but I need to get many, many, I mean many Fs stats. It actually takes too long for proc x12 statement to give me the results, so I wonder if it is possible to get SAS running only on Fs stats and not loosing time in all other tables calculation : it needs only table B1, B2 and B3 to get Fs. Any suggestions other than to code manually the process to get my results faster? Because it is already done, but I want as fast as possible, I'm more statistician than programmer 😞 

 

That's the basic code for PROC X12 provided as exemple from SAS support. 

ods output D8A#1=SalesD8A_1;
ods output D8A#2=SalesD8A_2;
ods output D8A#3=SalesD8A_3;
ods output D8A#4=SalesD8A_4;
proc x12 data=sales date=date;
   var sales;
   transform power=0;
   arima model=( (0,1,1)(0,1,1) );
   estimate;
   x11;
run;

Also, on the side, another little question :

 

Stat M7 is :

                             sqrt(0.5* (7/Fs + 3*Fm/Fs) )

 

Is someone knows where the 7 come from? Is it the same 7 as general critical value to reject H0 for Fs that is many times used? We also want 7/Fs smaller than 1 to detect present combined seasonality, that's what's making me thinking that way. Any information on that 7 will be very welcome!!

 

Thank you all, and happy coding!

 

Marc

 

Ps : sorry for my english ahah not perfect!


 

Marc1123
Fluorite | Level 6

Hello Reeza, thank you to take time to answer!

 

Yes, the code works very well, takes 1 or 2 seconds to run, and i guess the # are to select one of the 4 outputs test values from D8A table (stable seasonnality, Kruskal-Wallis, moving seasonnality and combined seasonnality in order). I'm using just the first output, and shutted down the result viewer window, and it is still not fast enough. I would need to do about 2 or 3 millions iteration of the procedure, that would take around 1 month to my computer… 

 

Maybe it is the ACF or PACF plots or things like that those are done in X11 (i guess) they take lot of time.. I red in 'Seasonnal adjustement with the X11 method' (Ladirray Quenneville) how the whole X11 process is accomplished, and there's lot of thing (calcul and graphs) those are done that I really don't need and i didn't found how to avoid SAS from doing them even if it is not displayed...

 

Thanks again!

 

Marc

 

Reeza
Super User

Shutting down results viewer doesn't do anything, the results are still generated. Use ODS SELECT instead to select just the tables you need and to ensure the plots are not created. Try it please and if it doesn't work post back.

https://blogs.sas.com/content/iml/2013/05/24/turn-off-ods-for-simulations.html

 

You can also specify PLOTS=NONE on X12 (depending on versions).

 

Changing to X13 may also be faster. 

 

ods select none;
ods output D8A#1=SalesD8A_1;
ods output D8A#2=SalesD8A_2;
ods output D8A#3=SalesD8A_3;
ods output D8A#4=SalesD8A_4;
proc x12 data=sales date=date plots=none;
   var sales;
   transform power=0;
   arima model=( (0,1,1)(0,1,1) );
   estimate;
   x11;
run;
ods select all;
Marc1123
Fluorite | Level 6

Awsome! Sounds good, I'll try all of that tomorrow, definately, thank you very much!

 

Marc

Marc1123
Fluorite | Level 6

Hello Reeza,

 

Indeed, it is a bit faster, but still 0.3 second approx. with X13 statement... Well, I guess I can grab few fractions of second in the few other steps I'm doing, a total iteration is taking ~0.75 second now, almost better!

 

Thanks,

 

Marc

Tom
Super User Tom
Super User

Why are you using the ODS output? 

Doesn't the PROC allow you tor specify what tables you want to write using normal statements/options?

I would suspect that having to convert the report into ODS compatible format and then back into dataset compatible format is probably adding some time to step.

Marc1123
Fluorite | Level 6

Hello Tom,

 

I didn't know that ods output was taking more time than options in PROC X12 (X13 now!). I will try outstat option and get the D8Fs value, outstat is giving more infos than needed but maybe faster than ods output (?). Cleaning my code made compute time a little shorter too, I'm getting close to it. I am tempted to submit the Fs calculation from R code in my SAS program (with RLANG activated) and just not use PROC X13 statement but I'm not sure it worth it. (sorry to evocate the r word here...)

 

Thank you!

 

Marc

Tom
Super User Tom
Super User

There is also an OUTPUT statement in PROC X11 in addition to the OUTSTAT option.

 

If you are doing repetitive calls you might also look into use BY group processing to run all of the variations with one PROC call.

See this article https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html

 

Marc1123
Fluorite | Level 6

Hello Tom,

 

The link seems to show how to be efficient in the kind of simulation I try to do, thank you very much, with all your help I should be able to get a result quite soon, at least the coding part seems to be fixed!

 

Thanks to Reeza again too, that forum is very nice and helpful!!!

 

Marc

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1650 views
  • 6 likes
  • 3 in conversation