The sample requires a macro that can be downloaded from the Downloads tab. After downloading the program, the sample code on the Full Code tab can be submitted from your SAS session.
The macro supports up to four treatments. If the risk data is provided, the observations are displayed sorted by relative risk, and the graph includes the second panel showing the relative risk values.
Two macro variables, MYPATH and MACROLOC, are created at the beginning of the sample code. MYPATH contains the path to the directory in which the graphs and the HTML file are stored. This macro variable is currently set to C:\TEMP. The macro variable MACROLOC contains the path to the directory in which the SAS program AdverseEventRelativeRiskMacro.sas is stored. This program needs to be downloaded from the Downloads tab. In the sample code, AdverseEventRelativeRiskMacro.sas is expected to be in the C:\ folder.
The macro parameters are described below.
Macro Parameter | Description with default value |
---|---|
Data= | Data set name (required) |
Events= | Adverse events (required) |
Drug1= | Treatment #1 (at least one treatment is required) |
Drug2= | Treatment #2 |
Drug3= | Treatment #3 |
Drug4= | Treatment #4 |
Risk= | Relative Risk values |
UCL= | Upper confidence limit |
LCL= | Lower confidence limit |
Title= | Graph title |
Title2= | Graph subtitle |
FootNote= | Graph footnote |
FootNote2= | Graph footnote #2 |
CL= | Confidence value for Relative Risk label |
Width=640px | Width of the graph |
Height= | Height of the graph, which is estimated if not provided |
Bands=YES | Draw horizontal alternating bands |
Grid=NO | Draw borders |
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.
%let mypath=C:\temp;
%let macroLoc=C:\;
data ae;
input AE $1-30 A B Low Mean High;
label a="Drug A";
label b="Drug B";
label c="Drug C";
c = 2*a+b;
datalines;
ARTHRALGIA 1 3 1 7 48
NAUSEA 4 18 2 4 8
ANOREXIA 2 3 0.9 3.8 16
HEMATURIA 2 4 0.8 3.2 15
INSOMNIA 3 5.5 1.1 3.0 7
VOMITING 3.5 6 1.2 2.5 6
DYSPEPSIA 4 10 1.1 2.4 4.5
WEIGHT DECREASE 1.5 3 0.5 2.0 4.2
RESPIRATORY DISORDER 3 4 0.4 1.4 4
HEADACHE 7 10 0.8 1.1 2
GASTROESOPHAGEAL REFLUX 3 4 0.5 1.05 3.8
BACK PAIN 5 6 0.8 1.04 2
CHRONIC OBSTRUCTIVE AIRWAY 22 38 0.6 0.7 0.8
DYSPNEA 7 2.5 0.13 0.3 0.7
ARTHRALGIA2 1 3 1 5 48
NAUSEA2 4 18 2 7 8
ANOREXIA2 2 3 0.9 4 16
HEMATURIA2 2 4 0.8 5 15
INSOMNIA2 3 5.5 1.1 6 7
VOMITING2 3.5 6 1.2 8 16
DYSPEPSIA2 4 10 1.1 4 4.5
WEIGHT DECREASE2 1.5 3 0.5 4 4.2
RESPIRATORY DISORDER2 3 4 0.4 3 4
HEADACHE2 7 10 0.8 4 6
GASTROESOPHAGEAL REFLUX2 3 4 0.5 4 7
BACK PAIN2 5 6 0.8 1.5 2
CHRONIC OBSTRUCTIVE AIRWAY2 22 38 0.6 1 2
;
run;
data ae2;
set ae(obs=6);
run;
data ae3;
set ae(obs=10);
run;
options sasautos=("¯oLoc", sasautos);
ods listing close;
ods html image_dpi=100 file='adverseevents.html' path="&mypath";
ods graphics / reset noborder width=600px height=400px;
%AdverseEventRelativeRiskMacro(data=ae3, events=ae, drug1=a, drug2=b,
title=%str(Most Frequent On-Therapy Adverse Events),
title2=Sorted by Relative Risk, Width=6.4in,
CL=95, risk=mean, UCL=high, LCL=low, Grid=Yes);
%AdverseEventRelativeRiskMacro(data=ae, events=ae, drug1=a, drug2=b,
title=%str(Most Frequent On-Therapy Adverse Events),
title2=Sorted by Relative Risk,
CL=95, risk=mean, UCL=high, LCL=low, bands=no, grid=yes);
%AdverseEventRelativeRiskMacro(data=ae3, events=ae, drug1=a, drug2=b, drug3=c,
title=%str(Most Frequent On-Therapy Adverse Events),
title2=Sorted by Relative Risk,
footnote=%str(Footnote # 1),
footnote2=%str(Footnote # 2),
risk=mean, UCL=high, LCL=low);
%AdverseEventRelativeRiskMacro(data=ae3, events=ae, drug1=a, drug2=b, drug3=c,
title=%str(Most Frequent On-Therapy Adverse Events));
options nomprint nomlogic;
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: | Query and Reporting ==> Creating Reports ==> Graphical ==> Clinical Macros |
Date Modified: | 2011-08-11 11:45:24 |
Date Created: | 2011-07-19 09:16:30 |
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 | |||
Windows Vista for x64 | 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 |