This sample uses the Graph Template Language (GTL) to produce a bar chart with a scatter plot overlay. The graph displays the percent of the top twenty advserse events.
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 adverseEvents;
attrib aedecod length=$46 label='Dictionary-Derived Term';
attrib arm length=$20 label='Description of Planned Arm';
attrib count length=8 label='Frequency Count';
attrib percent length=8 label='Percent of Total Frequency';
infile datalines dsd;
input aedecod arm count percent ;
format barht percent.;
if arm="Placebo" && (mod(_n_, 2) = 0) then barht=.035;
datalines;
PRURITUS,Placebo,11,0.00923593618807
PRURITUS,Drug A,38,0.03190596137699
PRURITUS,Drug B,35,0.02938706968933
APPLICATION SITE PRURITUS,Placebo,10,0.00839630562552
APPLICATION SITE PRURITUS,Drug A,35,0.02938706968933
APPLICATION SITE PRURITUS,Drug B,33,0.02770780856423
ERYTHEMA,Placebo,13,0.01091519731318
ERYTHEMA,Drug A,22,0.01847187237615
ERYTHEMA,Drug B,24,0.02015113350125
APPLICATION SITE ERYTHEMA,Placebo,3,0.00251889168765
APPLICATION SITE ERYTHEMA,Drug A,23,0.0193115029387
APPLICATION SITE ERYTHEMA,Drug B,20,0.01679261125104
RASH,Placebo,9,0.00755667506297
RASH,Drug A,18,0.01511335012594
RASH,Drug B,18,0.01511335012594
APPLICATION SITE IRRITATION,Placebo,7,0.00587741393786
APPLICATION SITE IRRITATION,Drug A,16,0.01343408900083
APPLICATION SITE IRRITATION,Drug B,18,0.01511335012594
APPLICATION SITE DERMATITIS,Placebo,9,0.00755667506297
APPLICATION SITE DERMATITIS,Drug A,12,0.01007556675062
APPLICATION SITE DERMATITIS,Drug B,15,0.01259445843828
DIZZINESS,Placebo,3,0.00251889168765
DIZZINESS,Drug A,18,0.01511335012594
DIZZINESS,Drug B,13,0.01091519731318
SKIN IRRITATION,Placebo,4,0.0033585222502
SKIN IRRITATION,Drug A,8,0.00671704450041
SKIN IRRITATION,Drug B,13,0.01091519731318
SINUS BRADYCARDIA,Placebo,2,0.0016792611251
SINUS BRADYCARDIA,Drug A,12,0.01007556675062
SINUS BRADYCARDIA,Drug B,10,0.00839630562552
DIARRHOEA,Placebo,10,0.00839630562552
DIARRHOEA,Drug A,4,0.0033585222502
DIARRHOEA,Drug B,7,0.00587741393786
HEADACHE,Placebo,8,0.00671704450041
HEADACHE,Drug A,9,0.00755667506297
HEADACHE,Drug B,4,0.0033585222502
NASOPHARYNGITIS,Placebo,4,0.0033585222502
NASOPHARYNGITIS,Drug A,8,0.00671704450041
NASOPHARYNGITIS,Drug B,9,0.00755667506297
NAUSEA,Placebo,3,0.00251889168765
NAUSEA,Drug A,13,0.01091519731318
NAUSEA,Drug B,5,0.00419815281276
COUGH,Placebo,4,0.0033585222502
COUGH,Drug A,7,0.00587741393786
COUGH,Drug B,9,0.00755667506297
UPPER RESPIRATORY TRACT INFECTION,Placebo,12,0.01007556675062
UPPER RESPIRATORY TRACT INFECTION,Drug A,5,0.00419815281276
UPPER RESPIRATORY TRACT INFECTION,Drug B,2,0.0016792611251
HYPERHIDROSIS,Placebo,2,0.0016792611251
HYPERHIDROSIS,Drug A,10,0.00839630562552
HYPERHIDROSIS,Drug B,5,0.00419815281276
MYOCARDIAL INFARCTION,Placebo,4,0.0033585222502
MYOCARDIAL INFARCTION,Drug A,8,0.00671704450041
MYOCARDIAL INFARCTION,Drug B,4,0.0033585222502
VOMITING,Placebo,3,0.00251889168765
VOMITING,Drug A,9,0.00755667506297
VOMITING,Drug B,4,0.0033585222502
APPLICATION SITE VESICLES,Placebo,2,0.0016792611251
APPLICATION SITE VESICLES,Drug A,6,0.00503778337531
APPLICATION SITE VESICLES,Drug B,5,0.00419815281276
;
run;
proc template;
define statgraph Top20AdverseEvents;
begingraph;
entrytitle "Percent of Top Twenty Adverse Events";
layout overlay / yaxisopts=(reverse=true tickvalueattrs=(size=6pt)
display=( tickvalues line) )
xaxisopts=(display=(ticks tickvalues line)
tickvalueattrs=(size=6pt));
barchart x= aedecod y=barht / orient=horizontal
display=(fill) datatransparency=0.5;
scatterplot y=aedecod x=percent / group=arm name='scatter'
markerattrs=(size=9 weight=bold);
discretelegend 'scatter' / down=1;
endlayout;
endgraph;
end;
run;
ods listing close;
ods html image_dpi=100 file='AdverseEvents.html' path='.';
ods graphics / reset noborder width=600px height=400px
imagename="Top20AdverseEvents" imagefmt=gif noscale;
proc sgrender data=adverseEvents template=Top20AdverseEvents;
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-08 15:18:45 |
Date Created: | 2010-03-25 09:05:46 |
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 |