Effective Forecast Visualization Using SAS/Graph

From sasCommunity

Jump to: navigation, search

Effective Forecast Visualization Using SAS/Graph

This presentation was given at SAS Global Forum 2007. More details will be included soon.


[edit] Author

Samuel T. Croker

[edit] Abstract

A statistical forecast is useless without sharp, attractive and informative graphics to present it. SAS/GRAPH® can produce superior results without resorting to exporting the data and drawing in Microsoft Excel. This case study demonstrates this simplicity using a few macros that make it possible to generate production quality forecast, confidence interval and other forecast-specific visualizations for appropriate SAS procedures. Methods for dealing with odd date intervals and usefully displaying difficult datetime axis values are explored. The ANNOTATE facility is used to help with displaying model and additional date information. A method for displaying confidence intervals as regions is shown as well as a way to produce separate regions for different types of data. Use of SYMBOL, AXIS and LEGEND statements is discussed along with details for using fonts, colors and lines to make the graphics look magazine worthy.


[edit] Presentation Materials

  • Media:Effective_Forecast_Visualization_Using_SAS.pdf
  • Media:Forecastmacro2007.txt
  • --SamC 18:07, 23 April 2007 (EDT)


    Use the following source from SAS ftp.sas.com


    and make the following additions:

    To PROC ARIMA (at the end):

         forecast out=fcp back=24 lead=48 id=timeid interval=hour;

    To the data step:

         timeid='01JAN2007/00:00:00'dt + (_n_*3600);

    To use the ACTIVEX device the results have to be displayed as a web page in Internet Explorer or any other browser that supports ACTIVEX components. The following change must be made to the macro to accomplish this.

         ods html file="<<full output path and filename>>";
         proc gplot ...
         quit;
         ods html close;
    

    One of the frustrating things about using SAS/Graph devices is that GOPTIONS, ANNOTATE, SYMBOL and AXIS statements behave differently. This means that if the device is changed the code must also be tweaked. This presentation contains information specific to the ACTIVEX device but I have generalized code for using devices such as GIF and JPEG as well and I will add this code soon. Feel free to contact me at scoyote@scoyote.net for individual questions and help.


    --SamC 08:33, 2 May 2007 (EDT)
Personal tools