SAS ODS Graphics Designer - UISUG

3y ago
107 Views
3 Downloads
1.24 MB
29 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Asher Boatman
Transcription

SAS ODS Graphics Designer William KnabeFormer Director of Statistical Data Applications,UI Information Technology ServicesSAS Summer Training Institute 2018Slide 1

Overview of Slide PresentationEvolution of ODS GraphicsHow to Build a Multi-Cell Graph Early Development of SAS Graphics Ad-Hoc Multi-Cell Graph Structural Anatomy of SAS Graphics Classification Panels Graphics Template Language (GTL) Scatter Plot Matrix Latest Features of SAS GraphicsAccessing ODS Graphics Designer The User Interface The Graph GalleryHow to Build a Simple ODS Graph Step 1: Select Graph Type Step 2: Select Data, Plot, Variables Step 3: Customize and ProduceGraphSAS Summer Training Institute 2018How to View the GTL CodeBuilding Complex Graphic Templates in GTLCreating Templates for Batchable [Repeatable] GraphsAuto Charts with SAS 9.4Learn More References and Review ExercisesSlide 2

Evolution of ODS GraphicsEarly Development of SAS Graphics In the beginning SAS had a less than stellar reputation regardinggraphics output. PROC PLOT produced crude raster graphics using a line printer. Then there was SAS/GRAPH and visuals became better. Vector graphics used to produce quality output. Lots of options but too many to learn well (difficult to use “on the fly”). Output was stored in graphics catalogs (required prior knowledge). Not too friendly with Microsoft Office products. Finally came the development of ODS Statistical Graphics Procedures. Introduced multiple graphics operations incorporated within SASstatistical procedures in Base SAS or as stand-alone SAS procedures(SGPLOT, SGPANEL, SGSCATTER). Still code driven but new graphics template language developed. PNG output files sharable with Microsoft Office products.SAS Summer Training Institute 2018Slide 3

How to Create Graphs AutomaticallyFrom Within SAS ProceduresNote: In SAS 9.4 ODS graphics are by default turned “on” and graphs are automaticallygenerated. If you do not want these graphs you can type the command “ods graphicsoff” prior to the PROC statement.Use of Output Delivery System (ODS) commands allows you to create PDF, RTF, orHTML files that contain graphical content. Note: By default, SAS 9.4 produces outputin HTML.SAS Summer Training Institute 2018Slide 4

StructuralAnatomy of xisFootnoteSource: SAS/GRAPH 9.2 : Graphical Template Language ReferenceSAS Summer Training Institute 2018Slide 5

Graphics Template Language (GTL) An extension of the Output Delivery System (ODS) Quality graphics generated using a template to formatgraphic layout, text, legends, and appearance Created for SAS users uncomfortable with thesefeatures Can create highly customized graphs using a two-partprocess Fully compatible with Microsoft Word and PowerPointSAS Summer Training Institute 2018Slide 6

Latest Features of SAS Graphics Drag & Drop/Point & Click version of SG Graphics – Wide array of plot types to choose from– Produces sophisticated graphs and overlays– Do not need to know template details or GTLODS Designer writes the code for you– Save template for re-use, editing, or sharing– Great way to start learning GTLCan create multi-cell graphs, classification panels, andscatterplot matrices in a single fileCan save graphic as image file for easy portabilityCan customize appearance to meet publication standardsSAS Summer Training Institute 2018Slide 7

Accessing ODS Graphics DesignerMethod 1: Open SAS Tools\ODSGraphicsDesignerMethod 2: %sgdesign %sgdesign(parameters )SAS Summer Training Institute 2018Slide 8

The User interfaceThe GraphGallery1. Element Panel:Contains plots,lines andinsets. To insertan element,click & drag tothe graph area2. Work Area:Containsgraphs youdesignSAS Summer Training Institute 2018Slide 9

THE GRAPH GALLERY Basic Grouped AnalyticalSAS Summer Training Institute 2018Slide 10

THE GRAPH GALLERY Custom Matrix PanelsSAS SummerPanel Training Institute 2018Slide 11

How to Build aSimple GraphIdentifyDatasetStep 1. After select graphtype, Assign Data dialogbox opensIdentifyPlot TypeStep 2. Select data, plot,and variables via dropdownsStep 3. Return to AssignData screen via a rightclickNumericVariableCharacterVariableSAS Summer Training Institute 2018Slide 12

ProducedBoxplot ofHeight by SexCan changethese defaults,by doubleclicking on thetextSAS Summer Training Institute 2018Slide 13

How to Add a chart To create a secondchart: Right-Mouseclick on chart andselect Add Column Can also chooseAdd Row Drag and Drop thedesired chart typefrom the PlotLayers onto thenew plot spaceSAS Summer Training Institute 2018Slide 14

Customize AppearanceTo change properties of achart, select component &right-mouse click. Includes Axis Labels, ChartTitle, Footnotes, etc. If applicable, may selectcommon row/column axisfor multiple charts You can change propertiesincluding line thickness,markers, colors, etc.SAS Summer Training Institute 2018Slide 15

Label/Axis ChangesThe Axis tab allows you to change color, font type, and font sizefor axes and labels. Each axis has to be changed individually Note: Font Size is in unit pointsSAS Summer Training Institute 2018Slide 16

ADDING A LEGENDTo addlegend,simply drag& drop thepreferredtype to theappropriatechartSAS Summer Training Institute 2018Slide 17

ODS Graphics Designer – Example Output CombinationScatterplot andhistogram forfictitious height/weight data Note thecombinedhorizontal axisSAS Summer Training Institute 2018Slide 18

ODS Graphics Designer – Example OutputCombination Bar Charts of Electric Company Revenue by Year(Left) and Revenue by Customer Type (Right)SAS Summer Training Institute 2018Slide 19

How to View the GTL CodeFrom the View Tab – Select Code This will open a copy of the graphic template language(GTL) utilized to create the plot. Similar to a macro, this code can be modified to create atemplate for future use. To do so, you should make the code as generic as possible,such that all dynamic arguments start with an underscoreand all quotes are removed. This code is also an excellent starting point for morecomplex graphic templates, including graphics that cannotbe built exclusively using the GUI interface.SAS Summer Training Institute 2018Slide 20

Creating Templates for Batchable Graphs Graphs created by Graphics Designer can be saved asSGD files. SGD files execute in batch mode using the SGDESIGNProcedure. The SGD file includes a reference to the data set usedwhen creating the graph. The same data set is usedunless a different name is provided. Graphics Designer allows usage of multiple data setsfor a single graph (one per cell). Dynamics in the graph can be substituted at runtime.SAS Summer Training Institute 2018Slide 21

Auto Charts with Designer in Sas 9.4 A new tool under Tools- Auto Charts allows the user tocreate a gallery of commonly used graphs for a set ofvariables in bulk. Univariate, bivariate, grouped and advanced graphs areavailable. This user-defined group of graphs (created by selection ofparticular variables and settings) can be placed in a customgallery (MyGraphs). This gallery can be opened at any time for furthercustomization and use.SAS Summer Training Institute 2018Slide 22

Building Complex Graphic Templates in GTLCreating a graph with the Graphic Template Language(GTL) is a two-step process: Step One: The TEMPLATE procedure Defines the structure of the graphic How the template is compiled and saved Does not create the graph by itself Step Two: The SGRENDER procedure Where the data is defined Creates the graphSource: Sanjay Matange. Getting Started with GTL – 1– Scatterplots posted October 25, 2013 via Graphically Speaking BlogSAS Summer Training Institute 2018Slide 23

Graphic Template Language: Two StepsWhere graph is defined.In proc template, thetemplate is assigned aname, which is called inproc sgrenderSource: Sanjay Matange. Getting Started with GTL – 1– Scatterplots posted October 25, 2013 via Graphically Speaking BlogSAS Summer Training Institute 2018Slide 24

Simple Scatterplot ExampleMost of this code is standard.The key component defining theplot is here.Note: The Layout overlay is themost basic container for singlecell plots.This code yields thissimple scatterplot.Source: Sanjay Matange. Getting Started with GTL – 1– Scatterplots posted October 25, 2013 via Graphically Speaking BlogSAS Summer Training Institute 2018Slide 25

Complicated Scatterplot ExampleIn the ODS Graphic Designer, it is a simple task to addcomponent to the scatterplot.We can also use thiscode to demonstratethe use of GTL withdynamic features.Source: Sanjay Matange. Getting Started with GTL – 1– Scatterplots posted October 25, 2013 via Graphically Speaking BlogSAS Summer Training Institute 2018Slide 26

GTL with Dynamic OptionsCalling the dynamic feature makes thetemplate more flexible.The dynamic variables (note theunderscore)Defines use of afilled circle w/ 80%transparencyDefines location and alignment of the legendValue ofdynamicvariablesdefined inSGRENDER.Source: Sanjay Matange. Getting Started with GTL – 1– Scatterplots posted October 25, 2013 via Graphically Speaking BlogSAS Summer Training Institute 2018Slide 27

Why Use Dynamics? Allows one to usesame template tocreate multiple graphs Simply change variabledefinitions inSGRENDER Example:Horsepower by MSRP usingDynamics templateSAS Summer Training Institute 2018Slide 28

Learn More DocumentationSAS 9.4 ODS Graphics Designer: User’s Guide, Third statdesignug/9.4/content/grstatdesignug.pdf?locale enSAS 9.4 ODS Graphics: Getting Started with Business and Statistical grsggs/64979/PDF/default/grsggs.pdf PapersSanjay Matange. Quick Results with SAS ODS Graphics tion/papers/sgf2012/153-2012.pdfPhilip R Holland. Using the ODS Graphics Designer to Create Your Own /proceedings10/034-2010.pdf PresentationsCharlotte Baker. Need a Scientific Journal Ready Graphic? No oceedings17/1440-2017.pdf BlogsSanjay Matange. Graphically Speaking: Data Visualization with a focus on ODS speaking/tag/ods-graphics-designer/SAS Summer Training Institute 2018Slide 29

Evolution of ODS Graphics Early Development of SAS Graphics In the beginning SAS had a less than stellar reputation regarding graphics output. PROC PLOT produced crude raster graphics using a line printer. Then there was SAS/GRAPH and visuals became better. Vector graphics used to produce quality output. Lots of options but too many to learn well (difficult to use “on the fly”).

Related Documents:

POStERallows manual ordering and automated re-ordering on re-execution pgm1.sas pgm2.sas pgm3.sas pgm4.sas pgm5.sas pgm6.sas pgm7.sas pgm8.sas pgm9.sas pgm10.sas pgm1.sas pgm2.sas pgm3.sas pgm4.sas pgm5.sas pgm6.sas pgm7.sas pgm8.sas pgm9.sas pgm10.sas 65 min 45 min 144% 100%

ODS Graphics Designer Drag & drop, point & click version of graphics -Wide array of plot types -Produces sophisticated graphs ODS Graphics Designer writes the code for you

ODS Graphics is one of the systems used to create analytical graphs in SAS First released with SAS 9.2 as part of SAS/GRAPH From SAS 9.3 onwards, ODS Graphics is part of Base SAS With this system, many SAS analytical procedures create graphics output automatically This system also provides other ways to create custom graphs

3 ODS Graphics Designer Eliminates the need to create template styles for graphics Who really mastered PROC TEMPLATE? United States Steel Corporation Preproduction in SAS 9.2 Release 2 (TS2M0) Part of Base SAS in 9.3 (No need for SAS/GRAPH) Drag & Drop and Point & Click version of SG Graphics Let ODS Graphics Designer write the code for you

What's New in SAS ODS Graphics This session explores the new graphical capabilities available directly from many existing SAS procedures and the new SG procedures. Also, learn more about what's new in ODS Graphics, including the ODS Graphics Designer, the ODS Graphics Editor, and the Graph Template Language. Updated to include 9.3 changes.

ODS Graphics works differently from SAS/GRAPH procedures. ODS Graphics output goes to open ODS destinations like HTML and PDF. ODS Graphics produces output in industry standard formats like PNG, PDF, SVG and many more. ODS Graphics produces high resolution graphs. Setting high DPI scales all aspects of the graph, including marker size and line .

SAS Output Delivery System (ODS) Graphics started appearing in SAS 9.2. Collectively these new tools were referred to as "ODS Graphics," "SG Graphics" and "Statistical Graphics". When first starting to use these tools, the traditional SAS/GRAPH software user might come upon some very significant

of its Animal Nutrition Series. The Food and Drug Administration relies on information in the report to regulate and ensure the safety of pet foods. Other reports in the series address the nutritional needs of horses, dairy cattle, beef cattle, nonhuman primates, swine, poultry, fish, and small ruminants. Scientists who study the nutritional needs of animals use the Animal Nutrition Series to .