Meta-Analysis Resources

Tools for Those Who Summarize the Evidence Base

Resources and networking for those who conduct or interpret meta-analyses related to any phenomenon that is gauged in multiple studies.

Hi,

I need to plot multiple RRs and CIs in groups similar to how it is shown on this page: http://blogs.sas.com/content/graphicallyspeaking/2012/08/12/non-bre...

I am not familiar with SAS, but I was able to use the code presented on the SAS blog and modify it with my own values. I have a few issues which I haven't been able to resolve

  • I need labels showing "Favors experimental" or "Favors placebo"
  • The SAS code doesn't show arrows when the Upper CI goes beyond the limits of the graph - so I need to know how to do this. 
  • I also need a label on top of the graph 

Here's the code, by the way: 

ods html close;

/*--This data sets has regular blanks for indentatin of the subgroup text--*/
data forest;
input Subgroup $1-25 Count Percent Mean Low High PCIGroup Group PValue;
zero=0;
PCI_lbl='PCI group';
Mean_lbl='Mean';
Low_lbl='Low';
High_lbl='High';
grp_lbl='Group';
sub_lbl='Subgroup';
pval_lbl='-';
if count ne . then CountPct=put(count, 4.0) || "(" || put(percent, 3.0) || ")";
id=_n_;
val=mod(_N_-1, 6);
if val eq 1 or val eq 2 or val eq 3 then do;
ref=subgroup;
idref=id;
end;
datalines;
Age . . . . . . . 0.05
<= 65 Yr 1534 71 1.5 1.05 1.9 17.0 13.2 .
> 65 Yr 632 29 0.8 0.6 1.25 17.8 21.3 .
Sex . . . . . . . 0.13
Male 1690 78 1.5 1.05 1.9 16.8 13.5 .
Female 476 22 0.8 0.6 1.3 18.3 22.9 .
Race or ethnic group . . . . . . . 0.52
Nonwhite 428 20 1.05 0.6 1.8 18.8 17.8 .
White 1738 80 1.2 0.6 1.6 16.7 15.0 .
From MI to Randomization . . . . . . . 0.81
<= 7 days 963 44 1.2 0.8 1.5 18.9 18.6 .
> 7 days 1203 56 1.15 0.75 1.5 15.9 12.9 .
Infract-related artery . . . . . . . 0.38
LAD 781 36 1.4 0.9 1.9 20.1 16.2 .
Other 1385 64 1.1 0.8 1.4 15.6 15.3 .
Ejection Fraction . . . . . . . 0.48
< 50% 1151 54 1.2 0.8 1.5 22.6 20.4 .
>= 50% 999 46 0.9 0.6 1.4 10.7 11.1 .
Diabetes . . . . . . . 0.41
Yes 446 21 1.4 0.9 2.0 29.3 23.3 .
No 1720 79 1.1 0.8 1.5 14.4 13.5 .
Killip class . . . . . . . 0.39
I 1740 81 1.2 0.8 1.6 15.2 13.1 .
II-IV 413 19 0.95 0.6 1.5 25.3 26.9 .
;
run;
proc sgplot data=forest noautolegend;
refline 1.0 / axis=x;
scatter y=subgroup x=mean / xerrorlower=low xerrorupper=high
markerattrs=(symbol=circlefilled);
scatter y=subgroup x=pci_lbl / markerchar=pcigroup x2axis;
scatter y=subgroup x=grp_lbl / markerchar=group x2axis;
scatter y=subgroup x=Mean_lbl / markerchar=Mean x2axis;
scatter y=subgroup x=Low_lbl / markerchar=Low x2axis;
scatter y=subgroup x=High_lbl / markerchar=High x2axis;
xaxis display=(nolabel noticks) offsetmin=0.5 values=(0 to 2 by 0.5)
valueattrs=(size=6);
x2axis display=(nolabel noticks) offsetmax=0.7 valueattrs=(size=6);
yaxis reverse display=(noticks nolabel) valueattrs=(size=6);
run;

Thanks in advance for your help. 

Views: 46

© 2017   Created by Blair T. Johnson.   Powered by

Badges  |  Report an Issue  |  Terms of Service