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.

Slides:



Advertisements
Similar presentations
Zhongmin Li and Geeta Mahendra
Advertisements

Using ODS Regions to Create Custom Reports Kate Morrow, M.S. Statistician Vermont Oxford Network, Burlington, VT.
Poster Template for a 841mm x 594mm poster presentation Your name and the names of the people who have contributed to this presentation go here. The names.
Outline Proc Report Tricks Kelley Weston. Outline Examples 1.Text that spans columnsText that spans columns 2.Patient-level detail in the titlesPatient-level.
Controlling SAS Graphics using ANNOTATE Datasets Elizabeth Campagna University of Colorado Denver Colorado Health Outcomes Program Colorado Day – Denver.
Analysis of Variance Compares means to determine if the population distributions are not similar Uses means and confidence intervals much like a t-test.
HSRP 734: Advanced Statistical Methods July 24, 2008.
Introduction to Excel 2007 Part 2: Bar Graphs and Histograms February 5, 2008.
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 2.2.
Reading Graphs and Charts are more attractive and easy to understand than tables enable the reader to ‘see’ patterns in the data are easy to use for comparisons.
Regression Analysis Using Excel. Econometrics Econometrics is simply the statistical analysis of economic phenomena Here, we just summarize some of the.
More Linear Regression Outliers, Influential Points, and Confidence Interval Construction.
T T20-06 Control Chart (with Runs Tests) Purpose Allows the analyst create and analyze a "Control Chart". A visual analysis of the control time.
Introduction to SQL Session 1 Retrieving Data From a Single Table.
Viewbox 4 Tutorial How to create a Template Please view this tutorial as a Slide Show in PowerPoint, because it contains animations that will not appear.
PAPER TITLE (TEMPLATE FOR A 841MM X 594MM POSTER PRESENTATION) The names of the authors The affiliation names go here Poster Basics Sections (ex: “1- INTRODUCTION”)
Understanding and Comparing Distributions
How To Make Graphs in Microsoft Excel Outline Making Bar Graphs Making Scatter Plots – 1 series Making Scatter Plots – Multiple Series.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
How to Build Tabular Dashboards Using Proc Report
SAS Lecture 5 – Some regression procedures Aidan McDermott, April 25, 2005.
Analysis of Variance. ANOVA Probably the most popular analysis in psychology Why? Ease of implementation Allows for analysis of several groups at once.
11 Chapter 3: Getting Started with Tasks 3.1 Introduction to Tasks and Wizards 3.2 Creating a Frequency Report 3.3 Generating HTML, PDF, and RTF Output.
Introduction to SAS Essentials Mastering SAS for Data Analytics
MBAC 611.  Within your private mbac611 folder create a lab5 folder.  Copy the Moodle file lab3_vars to your lab5 folder.  Start Mathematica  Enter.
Graphs in Science You Can Do It!!!.
Spreadsheet-Based Decision Support Systems Chapter 22:
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
STAT02 - Descriptive statistics (cont.) 1 Descriptive statistics (cont.) Lecturer: Smilen Dimitrov Applied statistics for testing and evaluation – MED4.
Introduction to Control Charts: XmR Chart
Quantitative Skills 1: Graphing
06/10/ Working with Data. 206/10/2015 Learning Objectives Explain the circumstances when the following might be useful: Disabling buttons and.
Worked examples and exercises are in the text STROUD (Prog. 28 in 7 th Ed) PROGRAMME 27 STATISTICS.
Tips & Tricks MASUG02/18/2005. Multiple Graphs on One Page.
Examples of different formulas and their uses....
TS02 SAS GTL - Injecting New Life into Graphs
Chapter 18 Four Multivariate Techniques Angela Gillis & Winston Jackson Nursing Research: Methods & Interpretation.
The Scientific Method Honors Biology Laboratory Skills.
Multiple Uses for a Simple SQL Procedure Rebecca Larsen University of South Florida.
Graphs An Introduction. What is a graph?  A graph is a visual representation of a relationship between, but not restricted to, two variables.  A graph.
Name : Tatiana “Tania” Harrison Office : 216 Phone number: CWU page: Syllabus Name :
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 2.2.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Advanced Stata Workshop FHSS Research Support Center.
Worked examples and exercises are in the text STROUD PROGRAMME 27 STATISTICS.
Effective SAS greplay’ing and how to avoid stretching By David Mottershead Senior Programmer, Quanticate.
Unit 2: Geographical Skills
Advanced Graphing Using Excel V.1 Part II: Giving your graph style Written and Created by: James Golen University of Michigan – Dearborn Science Learning.
MASUG September 15, Agenda  Guest Introductions  John Boling – SAS inSchool  Tim Garton – Health Forecasts  Announcements  Tips & Tricks 
CONDUCTING TESTS FOR STATISTICALLY-SIGNIFICANT DIFFERENCES USING FOREST INVENTORY DATA James A. Westfall Scott A. Pugh John W. Coulston U.S. Forest Service.
Conduct Simple Correlations Section 7. Correlation –A Pearson correlation analyzes relationships between parametric, linear (interval or ratio which are.
01/20151 EPI 5344: Survival Analysis in Epidemiology Estimating S(t) from Cox models March 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health.
Why The Bretz et al Examples Failed to Work In their discussion in the Biometrical Journal, Bretz et al. provide examples where the implementation of the.
1 Week # 4 Introduction to PDM PDM is a workbench environment that lets programmers and system operators navigate the three levels of the AS/400’s object-based.
1 PEER Session 02/04/15. 2  Multiple good data management software options exist – quantitative (e.g., SPSS), qualitative (e.g, atlas.ti), mixed (e.g.,
Chapter 6: Modifying and Combining Data Sets  The SET statement is a powerful statement in the DATA step DATA newdatasetname; SET olddatasetname;.. run;
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
User’s Guide to the ‘QDE Toolkit Pro’ National ResearchConseil national Council Canadade recherches Excel Tools for Presenting Metrological Comparisons.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
Additional Regression techniques Scott Harris October 2009.
Copyright © 2009 Pearson Education, Inc. 3.2 Picturing Distributions of Data LEARNING GOAL Be able to create and interpret basic bar graphs, dotplots,
OPERATORS IN C CHAPTER 3. Expressions can be built up from literals, variables and operators. The operators define how the variables and literals in the.
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.
03/20161 EPI 5344: Survival Analysis in Epidemiology Estimating S(t) from Cox models March 29, 2016 Dr. N. Birkett, School of Epidemiology, Public Health.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
Forest Plotting Analysis Macro %FORESTPLOT (Paper 3419)
Chapter 8: Inference for Proportions
The poster title goes here and here
Presentation transcript:

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 function for the creation of a Forest Plot. This becomes more difficult when trying to create several Forest Plots due to the necessary use of the Annotate Dataset. A Forest Plot can be as simple or as detailed as you like. The Figure below shows an example of a Forest Plot created using a detailed Annotation (Figure 1). As the Annotation process is essentially the creation of the dataset it is quite easy to create a macro for the creation of the Forest Plot.. The Macro can also be extended to control the whole of the code and therefore used on almost any data using a similar format. If we take the example given in Figure 1 a macro can be created to control the following:  The size, colour and style of the fonts  The positioning of the Treatment Labels and Counts  The axis ranges and numbering  How the Confidence Intervals are shown  The indicator variable to use to create the Plot (including specific values for this variable)  The Figure Titles, numbering and / or Footnotes  Where to store the output (if required) The Macro can be written to control the Annotate Dataset and therefore the Figure, the data or a combination of both to create a Forest Plot as detailed as required. The Steps before creating the Annotate Dataset are controlled through the Macro Call. Data manipulation can be performed as part of the macro or outside. A very simple example of the creation of the Confidence Intervals and Hazard Ratios is given in this Poster. Here you can control the input data, the significance of the Confidence Intervals and any subgroup on which you want the Figure to show. For ease of explanation the creation of the Hazard Ratios and Confidence Intervals is shown in a Macro and the Annotate dataset for the Labels and Confidence Intervals are shown in another two separate Macros. It is entirely possible for the creation of these to be carried out in a single macro. The Annotate dataset uses the options ‘move’, draw’, ‘text’ and ‘label’ only for the creation of Figure 1. It is created directly from the dataset that stores the Hazard Ratios and Confidence Intervals to allow correct drawing of the lines and tips. The y and x variables tell SAS ® where to position the lines and the ‘move’ and ‘draw’ options tell SAS ® when to create the lines. Firstly the creation of the Confidence Intervals : %macro hazard(byvar=, meas=, cens=, censval=, sign=, var1=); proc phreg data=data1 outest=pdata2; by &byvar. ; model &meas.*&cens.(&censval.) = &var1 / alpha=&sign. rl; ODS OUTPUT PARAMETERESTIMATES = ESTS; run; ods listing; ****** ANY MANIPULATION REQUIRED *******; ****** For Manipulation of the estimates dataset ******; %mend; Once the dataset with the estimates for the Confidence Intervals and Hazard Ratios is created the annotation dataset for the drawing of the Confidence Intervals can be created: %macro confid (order =, sty=, col=, tips=, haz=, low=, upp=) data bars; set est; if &haz ne.; length function $8. text $40.; xsys = '2'; ysys = '2'; color=&col; y=id; x=&haz.; function='move'; output; if lcl gt 0 then do; x=lcl; function='draw'; output; link tips; end; if ucl ne. then do; x=ucl; function='draw'; output; link tips; end; return; *--- Tips of Confidence intervals; y=id-&tips.; function = 'move'; output; y=id+&tips.; function= 'draw'; output; y=id; function='move'; output; return; run; %mend; The information created in the macro above will be added to the estimates dataset and stored as the dataset BARS. The Hazard Ratio and Confidence Interval variables are included in the Macro call for ease where you have multiple results calculated on different groups in a dataset. Define any subgroup here. This is the variable that has the measurements that you wish to analyse The variable that denotes a censored observation What value of the censored variable is for censored results The significance level you want to perform the test at The Treatment groups The value of ID has been previously set to ensure that the groups are displayed in the correct order. Define the order of the XAXSIS. This allows you to control each output separately Define the colour to be used in the Figure Define the style to be used for the Figure The size of the tips at the end of the confidence intervals, for no tips use tips=0 Define the variable that contains the Hazard Ratios, and the upper and lower confidence Intervals The next step is for the creation of the labels and text for inclusion on the Forest Plot. The labels and text to include on the Forest Plot use the function ‘LABEL’ to place the text on the figure at the given position. The macro to create the Labels and text for Figure 1 is given below. %macro label (haz=, col=, mn_order=, sty=, var2=, group1=, group2=, group3=, xpos=); data labels; set ests; if &haz =. then do; length function $8. text $50.; xsys = '2'; ysys = '2'; color=&col; *--- Labels for the subgroups; y=id; x=&mn_order.; style=“&sty"; function = 'label'; text=&var2; size=0.8; position='0'; output; *--- Number of event; position='0'; function='label'; if variable=&group1. then text = 'T1:'||trim(left(eg1))||'/'||trim(left(ng1))||‘ ('||trim(left(put(pg1,4.1)))||'%)'||'T3:'||trim(left(em1))||'/‘||trim(left(nm1)) ||' (' || trim(left(put(pm1,4.1))) || '%)'; if variable=&group2. then text = 'T2:'||trim(left(eg2))||'/'||trim(left(ng2))||‘ ('||trim(left(put(pg2,4.1)))||'%)'||'T3:'||trim(left(em2))||'/'||trim(left(nm2)) ||' ('|| trim(left(put(pm2,4.1))) || '%)'; if variable=&group3. then text = 'T1+T2:'||trim(left(eg3))||'/'||trim(left(ng3))|| ('||trim(left(put(pg3,4.1)))||'%)'||'T3:'||trim(left(em3))||'/'||trim(left(nm3)) ||' ('|| trim(left(put(pm3,4.1))) || '%)'; *--- CAN ADD ADDITIONAL TEXT IF MORE THAN 3 COMPARASIONS REQUIRED; y=id+0.1; x=&xpos.; size=0.8; output; run; %mend; The macro shown here has been created for a Forest Plot showing three comparisons only – however to add additional comparisons would simply need additions of the same text used for Number of Events. The final step here is to set the Confidence interval annotation with the Labels annotation to create the final Annotate Dataset. data anno; set bars labels; run; The Annotate dataset is then referenced directly in the graphical procedure as below. In order to have control over the axis and the Hazard Ratio that you will plot this must be part of the macro too: %macro plot (haz=, order=); proc gplot data=ests; bubble id*&haz=event / vaxis=axis1 haxis=axis2 anno=anno href=1; axis1 offset=(2,5) minor=none major=none value=none label=none style=0; axis2 ORDER=(&order.); run; quit; %mend; The use of the macros can ease the creation of Forest Plots using the SAS ® system. This is compounded when the need to create several plots using similar data arises. The four macros detailed here, along with any further data manipulation required, can be transformed into a single macro to allow a simpler process in order to create a detailed output. Tells SAS ® where to position the subgroup labels in relation to the XAXIS The variable that gives the subgroup labels The treatments used to calculate the counts to be shown. Up to 3 treatments can be given Tells SAS ® where to position the counts in relation to the XAXIS The variable containing the Hazard Ratio to be plotted The scale you want the XAXIS to be shown as i.e. -1 to 6 by 1 For the Macro to be as robust as possible it is recommended that the Macro be written for the data manipulation AND the creation of the Annotate Dataset. The Forest Plot can be created using a single Macro Call The Macro has been split into four parts for ease of explanation