This sample uses the Graph Template Language (GTL) to produce a step plot with error bars.
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.
data hazard;
input day A ALow AHigh ARisk B BLow BHigh BRisk;
label day='Days since randomization';
label A='Drug A';
label B='Drug B';
label ARisk='Drug A';
label BRisk='Drug B';
datalines;
0 . . . . . . . .
10 .0005 .0001 .0009 212 .0078 .007 .0086 428
30 .0007 .0002 .0012 199 .0026 .002 .0032 339
50 .0005 .0001 .0009 189 .0005 .0002 .0008 309
70 .0004 .0001 .0007 183 .001 .0006 .0014 297
90 .0001 . . 178 .0008 .0005 .0011 285
110 .0003 .0001 .0005 175 .0002 .0001 .0003 276
130 .0003 .0001 .0005 168 .0002 .0001 .0003 271
150 .0003 .0001 .0005 162 .0002 .0001 .0003 264
170 .0005 .0001 .0009 93 .001 .0005 .0015 148
190 .0 .0 .0 13 .003 .0 .006 19
200 . . . . . . . .
;
run;
proc template;
define statgraph hazard_function;
begingraph / designwidth=7in designheight=4.5in;
entrytitle 'Hazard Function for Adverse Events of Special Interest';
layout overlay / yaxisopts=(label='Hazard Rate')
xaxisopts=(linearopts=(viewmin=0
tickvaluelist=(0 20 40 60 80 100 120 140 160 180 200)));
stepplot x=day y=A / errorupper=AHigh errorlower=ALow justify=center
lineattrs=graphdata1(pattern=solid thickness=2)
errorbarattrs=graphdata1(pattern=solid thickness=2) name='a';
stepplot x=day y=B / errorupper=BHigh errorlower=BLow justify=center
lineattrs=graphdata2(pattern=dash thickness=2)
errorbarattrs=graphdata2(pattern=solid thickness=2) name='b';
discretelegend 'a' 'b' / location=inside halign=right valign=top across=1 border=true;
innermargin;
blockplot x=day block=BRisk / display=(values label outline) labelattrs=GraphData2 valueattrs=GraphData2;
blockplot x=day block=ARisk / display=(values label outline) labelattrs=GraphData1 valueattrs=GraphData1;
endinnermargin;
endlayout;
entryfootnote halign=left 'Table: Average number of subjects at risk during interval';
endgraph;
end;
run;
ods listing close;
ods html image_dpi=100 file='hazardfunction.html' path='.';
ods graphics / reset noborder width=600px height=400px
imagename="ClinicalHandout_HazardFunction" imagefmt=gif noscale;
proc sgrender data=hazard template=hazard_function;
run;
ods html close;
ods listing;
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: | SAS Reference ==> Procedures ==> SGRENDER Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Template Language (GTL) Query and Reporting ==> Creating Reports ==> Graphical ==> Health and Life Sciences Industry |
Date Modified: | 2010-04-07 15:29:10 |
Date Created: | 2010-03-19 11:29:16 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |||
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |||
Microsoft® Windows® for x64 | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |||
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |||
Microsoft Windows XP Professional | 9.2 TS1M0 | |||
Windows Vista | 9.2 TS1M0 | |||
64-bit Enabled AIX | 9.2 TS1M0 | |||
64-bit Enabled HP-UX | 9.2 TS1M0 | |||
64-bit Enabled Solaris | 9.2 TS1M0 | |||
HP-UX IPF | 9.2 TS1M0 | |||
Linux | 9.2 TS1M0 | |||
Linux for x64 | 9.2 TS1M0 | |||
OpenVMS on HP Integrity | 9.2 TS1M0 | |||
Solaris for x64 | 9.2 TS1M0 |