These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
The graphics output in the Results tab was produced using SAS® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
/* Create sample data for forest plot. */
data test;
input yvar $ 1-10 lower_limit rate upper_limit;
datalines;
Sohn 2002 1.2 1.5 2.2
Raine 2003 2.2 2.5 3.0
Snow 1999 0.8 1.3 4.4
;
run;
/* Create an annotate data set to draw the lines. */
data anno;
length function style color $8;
retain xsys ysys '2' when 'a';
set test;
/* Draw the horizontal line from lower_limit to upper_limit */
function='move'; xsys='2'; ysys='2'; yc=yvar; x=lower_limit; color='black'; output;
function='draw'; x=upper_limit; color='black'; size=1; output;
/* Draw the tick line for the lower_limit value */
function='move';xsys='2'; ysys='2';yc=yvar; x=lower_limit; color='black'; output;
function='draw';x=lower_limit; ysys='9'; y=+1; size=1; output;
function='draw';x=lower_limit; y=-2; size=1;output;
/* Draw the tick line for the upper_limit value */
function='move';xsys='2'; ysys='2'; yc=yvar; x=upper_limit; color='black'; output;
function='draw';x=upper_limit; ysys='9'; y=+1; size=1; output;
function='draw';x=upper_limit; y=-2; size=1; output;
run;
title1 'Forest Plot with PROC GPLOT';
axis1 label=none
minor=none
offset=(5,5);
axis2 order=(0 to 4.5 by 0.5)
label=('Odds Ratio')
minor=none;
symbol1 interpol=none color=black value=dot height=1.5;
proc gplot data=test;
plot yvar*rate / annotate=anno
nolegend
vaxis=axis1
haxis=axis2
href = 1
lhref = 2;
run;
quit;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Other Plots |
Date Modified: | 2009-05-08 11:25:23 |
Date Created: | 2009-05-01 16:51:44 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | Tru64 UNIX | 9.1 TS1M0 | |
OpenVMS Alpha | 9.1 TS1M0 | |||
Linux | 9.1 TS1M0 | |||
HP-UX IPF | 9.1 TS1M0 | |||
64-bit Enabled Solaris | 9.1 TS1M0 | |||
64-bit Enabled HP-UX | 9.1 TS1M0 | |||
64-bit Enabled AIX | 9.1 TS1M0 | |||
Microsoft Windows XP Professional | 9.1 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |||
Microsoft Windows NT Workstation | 9.1 TS1M0 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |||
Microsoft Windows 2000 Server | 9.1 TS1M0 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |||
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |||
z/OS | 9.1 TS1M0 |