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

Is there a way to tell SAS to create a data set with the data used to create graphs in PROC steps?

 

For example, in PROC VARMAX, the procedure produces a "Prediction Error Diagnostics Plot" which shows the ACF, PACF and IACF. I would like to save the data that produced those graphs into a SAS data set to create them in Excel.

 

Thanks. 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Yes! Most of the time at least. 

 

You run the proc, with ODS TRACE ON before and after, find the graph name and save that as an output data set. 

 

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

Here's an example for a different plot, I couldn't find the specific one you mentioned in the output so you likely are specifying an option somewhere. Table Names are also listed here: https://documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_varmax_details85.htm&docsetVersion=...

 

Line in red captures the data for the error distribution plot.

 

ods output ErrorDistribution = myGraphData;
proc varmax data=sashelp.workers plot(unpack)=(residual model forecasts);
   id date interval=month;
   model electric masonry / dify=(1,12) noint p=1;
   output lead=12;
run;

 


@Kevin_L_ wrote:

Is there a way to tell SAS to create a data set with the data used to create graphs in PROC steps?

 

For example, in PROC VARMAX, the procedure produces a "Prediction Error Diagnostics Plot" which shows the ACF, PACF and IACF. I would like to save the data that produced those graphs into a SAS data set to create them in Excel.

 

Thanks. 


 

View solution in original post

1 REPLY 1
Reeza
Super User

Yes! Most of the time at least. 

 

You run the proc, with ODS TRACE ON before and after, find the graph name and save that as an output data set. 

 

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

Here's an example for a different plot, I couldn't find the specific one you mentioned in the output so you likely are specifying an option somewhere. Table Names are also listed here: https://documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_varmax_details85.htm&docsetVersion=...

 

Line in red captures the data for the error distribution plot.

 

ods output ErrorDistribution = myGraphData;
proc varmax data=sashelp.workers plot(unpack)=(residual model forecasts);
   id date interval=month;
   model electric masonry / dify=(1,12) noint p=1;
   output lead=12;
run;

 


@Kevin_L_ wrote:

Is there a way to tell SAS to create a data set with the data used to create graphs in PROC steps?

 

For example, in PROC VARMAX, the procedure produces a "Prediction Error Diagnostics Plot" which shows the ACF, PACF and IACF. I would like to save the data that produced those graphs into a SAS data set to create them in Excel.

 

Thanks. 


 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 765 views
  • 0 likes
  • 2 in conversation