Behind the Scenes with SAS®: Using Customer Graphics in SAS® Output Louise Hadden Abt Associates Inc.

Slides:



Advertisements
Similar presentations
Internet Basics & Way Beyond!
Advertisements

Using ODS Regions to Create Custom Reports Kate Morrow, M.S. Statistician Vermont Oxford Network, Burlington, VT.
Controlling SAS Graphics using ANNOTATE Datasets Elizabeth Campagna University of Colorado Denver Colorado Health Outcomes Program Colorado Day – Denver.
How to Create a Custom Style Sonia Extremera / Antonio Nieto / Javier Gómez PhUSE Annual Conference, 9th-12th Oct 2011, Brighton UK.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
Xanthippe Stevens and Larry Hoyle Policy Research Institute The University of Kansas Visualizing Census Data.
Using HTML Tables.
Copyright © 2007, SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
Abstract # 0000 Make the Main Title with Large Bold Type Your Name Here Your Department Here Texas A&M Health Science Center Make the Main Title with Large.
The gchart Procedure The gchart Procedure is used to create bar charts of various types (it can also create pie charts. It’s most basic form would look.
Copyright © 2006, SAS Institute Inc. All rights reserved. Randy Poindexter & Scott Huntley Output Delivery and Reporting An Introduction to ODS.
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Working with Long Documents.
Introduction to SAS/Graph Don Miller 812 Oswald Tower
SAS® Maps as Tools to Display and Clarify Healthcare Outcomes Barbara B. Okerson, HMC, Richmond, VA.
Drill-down Graphs By Heather Hoffman. Family Practice Department Project  Create drill-down graphs that depict % of patients for each CCS* over a given.
Dashboards With PROC GKPI September 25, 2009 Barry Hong
Make the Main Title with Large Bold Type Your Name and Title Here Your Department Here Texas A&M Health Science Center Make the Main Title with Large Bold.
Abstract # 0000 Make the Main Title with Large Bold Type Use Smaller Type for the Subtitle. Above Type is 105pt. This Type is 70pt. Make authors’ names.
PROC GREPLAY With Templates December 5, 2008 Barry Hong Process Analysis and Simulation U. S. Steel Canada © 2008 United States Steel Corporation.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS ESSENTIALS -- Elliott & Woodward1.
Tips & Tricks MASUG02/18/2005. Multiple Graphs on One Page.
TS02 SAS GTL - Injecting New Life into Graphs
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
Copyright © 2008 SAS Institute Inc. All rights reserved. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks.
ODS Statistical Graphics in SAS 9.2 January 17, 2010.
Copyright © 2006, SAS Institute Inc. All rights reserved. SAS Enterprise Guide Old Proc – New Tricks? Tim Trussell Academic Program, SAS Canada world diabetes.
CREATING TEMPLATES CREATING CUSTOM CHARACTERS IMPORTING BATCH DATA SAVING DATA & TEMPLATES CREATING SERIES DATA PRINTING THE DATA.
Copyright © 2005, SAS Institute Inc. All rights reserved. Effective Use of SAS/GRAPH® Stored Processes Pat Berryman Senior Software Manager Data Visualization.
SAS Software Version 8 The Output Delivery System.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Using the new Version 8 Template Procedure for Complete Control of SAS Output Style and Format David Ghan Technical Training Specialist SAS, Canada.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office Word 2007 Lab 3 Creating Reports and Tables.
Copyright © 2014, SAS Institute Inc. All rights reserved. ACCESSIBILITY TIPS AND TRICKS FOR SAS PROGRAMMERS ED SUMMERS SENIOR MANAGER, ACCESSIBILITY.
Return to Outline Copyright © 2011 by Maribeth H. Price 3-1 Labeling and annotation.
ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH ® and PROC TABULATE Presented by Aaron Rabushka © Aaron Rabushka 2000.
Statistical Graphics for the SAS System Computing for Research I 01/29/2014 Nathaniel L Baker.
Effective SAS greplay’ing and how to avoid stretching By David Mottershead Senior Programmer, Quanticate.
PROC GPLOT GPLOT is used to make two dimensional scatter-plots. General Syntax: proc gplot data=data-set options; plot y-variable*x-variable/options; run;
Working with Themes, Quick Parts, Page Backgrounds, and Headers and Footers Lesson 7.
MASUG September 15, Agenda  Guest Introductions  John Boling – SAS inSchool  Tim Garton – Health Forecasts  Announcements  Tips & Tricks 
©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society.
Introduction to Technology. Parts of MSWord Screen Title Bar Quick Access Toolbar Button Ribbon Status Bar (views and zoom)
Creating Geographic Rating Area Maps: How to Combine Counties, Split Counties, & use Zip Code Boundaries Rick Andrews Office of the Actuary Centers for.
SAS ® is a very powerful tool when producing Graphics. A single graphical data step can easily create a Kaplan Meier Plot, but there is no single graphical.
SAS Beyond TFLs: An Application as a Statistician’s Tool William Coar Date: 10/15/2009 Denver SAS User’s Group.
PROC CATALOG The Wish Book SAS® Procedure. 2 PROC CATALOG, the Wish Book SAS® Procedure Louise S. Hadden Abt Associates Inc. PROC CATALOG, the Wish Book.
CMS SAS Users Group Conference Learn more about THE POWER TO KNOW ® October 17, 2011 PROC GMAP, HTML and You Thomas Kornfield, CMS.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
CMS SAS Users Group Conference Learn more about THE POWER TO KNOW ® October 17, 2011 Using SAS® to Create Custom Healthcare Graphics Barbara B. Okerson.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Make the Main Title with Large Bold Type Use Smaller Type for the Subtitle. Above Type is 110pt. This Type is 80pt. Make authors’ names smaller. This is.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
A MORE COMPLETE ODS REPORT. What we’re going to talk about…  Creating a title page  Creating an introduction page  Creating long-form text descriptions.
Tips for Inserting Graphs or Images Tips for Title/Headers Bar Color
Poster Title Author #1 name, ABC Corporation, City, Country Author #2 name, ABC Corporation, City, Country Abstract A brief abstract at the beginning summarizes.
Poster Title Author #1 name, ABC Corporation, City, Country Author #2 name, ABC Corporation, City, Country Abstract A brief abstract at the beginning summarizes.
Tips for Inserting Graphs or Images Tips for Title/Headers Bar Color
ON PATHS LESS TRODDEN… Excursions in SAS/GRAPH® PROC TABULATE and
PROC DOC III: Self-generating Codebooks Using SAS®
Computing for Research I 01/26/2011 N. Baker
Replace with logo Abstract (Click on the text to edit) Methods Results
Author: Kaiqing Fan Company: Mastech Digital Inc.
Replace with logo Abstract (Click on the text to edit) Methods Results
Replace with logo Methods Results Abstract (Click on the text to edit)
Replace with logo Abstract (Click on the text to edit) Methods Results
Replace with logo Abstract (Click on the text to edit) Methods Results
Presentation transcript:

Behind the Scenes with SAS®: Using Customer Graphics in SAS® Output Louise Hadden Abt Associates Inc.

2 Introduction SAS® provides many opportunities to add customized images to SAS ODS output. This presentation will demonstrate: adding custom backgrounds to tabular and graphic output; adding custom images to titles, footnotes, ODS text fields and tabular output; adding custom "fills" to SAS/GRAPH maps and graphs; Adding custom annotations to ODS GRAPHICS.

3 Introduction

4 Modifying a Style Template There’s no reason to reinvent the wheel when creating a style template. SAS provides a number of style templates which can be used as the “parent” for a new style. proc template; define style styles.usariem; parent=styles.minimal; replace graphbackground / background=colors('docbg') backgroundimage='rippleflag.jpg' ; end; run;

5 Modifying a Style Template

6 Images as Graph Backgrounds SAS/GRAPH procedures that produce an image, such as GCHART and GMAP, allow the placement of custom images in the graph’s background area. goptions iback=’external image file’ imagestyle=fit; /* or tile (tile is default)*/ Check the SAS documentation for information on what types of images work with which ODS destinations! Make sure your images “fit” your graph so that you don’t get poor quality or “stretched” images in your graph background.

7 Images as Graph Backgrounds goptions reset=all xpixels=900 ypixels=750 device=jpeg ftext="Arial/bo" cback=vpag; goptions border iback='canyon1.jpg' imagestyle=fit htitle=2.75 htext=1.3; ods listing close; ods html path=odsout body='tryit.htm' ; Title h=2 font=Arial bold italic 'Admissions by Zipcode - Southern Nevada'; proc gmap data=clark map=clark ; id zip; choro count_adm / coutline=black annotate=labels_clark name="tryit"; run; ods html close; ods listing;

8 Images as Graph Backgrounds

9 Images in the "Backplane" Placing an image on a backplane, or “frame”, works with the GCHART, GPLOT, GRADAR, and GSLIDE procedures. The syntax is to place the “iframe” option on the procedure that generates the graph. “iframe” can refer to a fully qualified image name or a file reference (fileref.) The default is to tile the image to fit the backplane. You must specify “imagestyle=fit” to stretch the image to fit in the backplane.

10 Images in the "Backplane" options orientation=landscape; goptions reset=all hsize=5 vsize=4 transparency border; ods html file='trylayout.htm' device=png ; proc gplot data=anal; plot v16_a*wt_lbs / iframe=aa imagestyle=fit; run; ods _all_ close;

11 Images in the "Backplane"

12 Images as Patterns Custom images can be placed on two- dimensional bars of graphs generated by PROC GCHART’s VBAR and HBAR statements. They can also be placed on three-dimensional (3D) bar graphs if the device used is ACTIVEX or ACTXIMG. Images are specified in the PATTERN statement using the IMAGE option. Pattern image=fileref; OR Pattern image=’external-image-file’;

13 Images as Patterns 2D pattern1 v=s image='amerdogtickpair.jpg'; pattern2 v=s image='anibug.gif'; pattern3 v=s image='browndogpair.jpg'; axis2 label=('') minor=none; axis1 label=('');... proc gchart data=a2; vbar year / maxis=axis1 raxis=axis2 discrete type=sum sumvar=value subgroup=value coutline='black' width=15 nolegend ascending space=5 frame iframe='lonestargroup4.jpg' imagestyle=tile;

14 Images as Patterns

15 Images as Patterns 3D GOPTIONS DEVICE=actximg; pattern1 v=s image='amerdogtickpair.jpg'; pattern2 v=s image='anibug.gif'; pattern3 v=s image='browndogpair.jpg'; axis2 label=('') minor=none; axis1 label=(''); proc gchart data=a2; vbar3d year / maxis=axis1 raxis=axis2 discrete type=sum sumvar=value subgroup=value coutline='black' width=15 nolegend ascending space=5 frame iframe='lonestargroup4.jpg' imagestyle=tile; run;

16 Images as Patterns

17 Images in In-Line Styles Pre and Post images may be added to titles, table cells, footnotes, header cells, and ODS TEXT fields via ODS ESCAPECHAR or using formats. ods escapechar="^"; ods text='^S={preimage="cmsnew.jpg"}';

18 Images in In-Line Styles Data driven sparklines & PROC REPORT

19 Annotated Images It is possible to annotate images onto SAS/GRAPH output. New in SAS 9.3, it is ALSO possible to annotate images in SG procedural output. data logo_anno; length function $ 8; xsys='3'; ysys='3'; when='a'; function='move'; x=2; y=85; output; function='image'; x=x+25.4; y=y+14; imgpath='smallcmsx.png'; style='fit'; output; /* use style='fit' or 'tile' */ run;

20 Annotated Images /* move the graph down with a empty title statement so there is room for the logo */ title1 h=15; title2 /* h=2 */ "Figure 2.1. Percentage of Nursing Home Residents by Sex and Year; United States, "; proc gchart data=my_data anno=logo_anno; format stack_order barfmt.; vbar year / discrete type=sum sumvar=percent subgroup=stack_order coutline=gray55 space=2 width=8 noframe raxis=axis1 maxis=axis2 legend=legend1 annotate=barlabel html=my_html des='' name="&name"; run; quit;

21 Annotated Images

22 SAS/GRAPH GREPLAY In this example, based on one of Robert Allison’s samples, a map and bar chart are created separately, and then the bar chart is overlaid on the map using PROC GREPLAY. proc greplay nofs; igout=work.gseg; delete _all_; goptions nodisplay;

23 SAS/GRAPH GREPLAY /* 1st map & bar chart */ title1 height=2 "Decline in Exclusive Breastfeeding from 0 to 5 Months"; title2 font="arial/bo" height=2 "(based on DHS data)"; proc gmap data=work.mydata map=work.clipped_world all; id country_name; choro gnc_usd / levels=4 html=myhtmlvar1 coutline=black nolegend des='' name='map'; run;

24 SAS/GRAPH GREPLAY pattern1 v=s c=graydd; axis1 label=none major=(number=5) minor=none; axis2 label=none; title h=10pct " "; /* just to add some space at top of bar chart */ footnote h=4pct " "; proc gchart data=work.mydata; vbar country_name / sumvar=diff0_5 descending raxis=axis1 maxis=axis2 noframe caxis=graydd des='' name='bar'; run;

25 SAS/GRAPH GREPLAY goptions display; goptions border; proc greplay tc=tempcat nofs igout=work.gseg; tdef one des='One' 1/ llx = 0 lly = 0 ulx = 0 uly = 100 urx = 100 ury = 100 lrx = 100 lry = 0 ; template = one; treplay 1:bar 1: map des='' name="&name"; run;

26 SAS/GRAPH GREPLAY

27 Special Fonts in SAS/GRAPH It is possible to use special font “glyphs” as markers, etc. in SAS/GRAPH You are encouraged to consult the section on specifying fonts in SAS/GRAPH in the 9.3 documentation for more details.

28 Special Fonts in SAS/GRAPH axis1 label=(font="Helvetica" '5 Star Ratings ' color=red font="Monotype Sorts" '48'x ) order=(0 to 30 by 5) minor=none offset=(0,0); axis2 label=none offset=(5,5); symbol1 i=join ci=red color=red font="Monotype Sorts" v='48'x height=3; title1 c=red "Monotype Sorts " c=black "font characters"; title2 a=-90 " "; footnote "5 Star Ratings - all values in " c=red font="Monotype Sorts" '48'x; proc gplot data=a; plot value*midpoint / vaxis=axis1 haxis=axis2 cframe=white des="" name="&name" ; run;

29 Special Fonts in SAS/GRAPH

30 What’s next? SAS has given a lot of control to the user in ODS GRAPHICS and the SG PROCs. It is possible to output an editable graph with a SG PROCEDURE when running interactively. The statement below placed above an SG procedure will place an editable image in the results window. The image opens with the ODS graphics editor. ods listing sge=on;

31 What’s next?

32 Conclusion SAS and ODS provide SAS programmers with many options to include custom images and logos behind the scenes in procedural output. Among these options are custom style templates, custom graph backgrounds, custom graph backplanes, custom patterns on bar graphs, replaying graphic images, annotate and DSGI. ODS output, including ODS GRAPHICS, can be greatly enhanced by the use of these options.

33 Acknowledgements Robert Allison of SAS®, SAS/GRAPH Wizard; Scott Huntley of SAS®, ODS Printer Guru; Mike Zdeb, SAS/GRAPH® Map Expert, who truly does make mapping easy with SAS®; Cynthia Zender of SAS®; Dan Heath of SAS®; Mike Kalt of SAS® SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.

34 Contact Information Code for any of the examples shown is available by request. Your comments and questions are valued and encouraged. Contact the author at: