05-19-2014 05:39 PM
You might want to state which version of SAS you are using as the SG procedures have gone through lots of improvements in the last few releases. My first likely solution is for an older versiona but I believe there have been options added that might do what you need.
Also posting your code and an example of the data might make responses quicker.
05-19-2014 08:08 PM
I believe there is a GTL example of a FOREST plot, as well as an SG Procedure example of a FOREST plot. You should be able to search in support.sas.com to find the example links. See screen shots.
05-19-2014 08:45 PM
Thanks Ballard and Cynthia,
I'm using SAS 9.3 on windows. Yes, there is an example from Sanjay's blog using GTL but I was trying to output similar output using SGPLOT. But the problem is, I couldn't group them together with a space in between each group.
Below is the code i'm using
proc sgplot data=forest&i noautolegend;
scatter y = subgroup x = orval / xerrorupper = upper_limit
xerrorlower = lower_limit
markerattrs = graphdata1 (symbol = squarefilled);
scatter y = subgroup x = trt1_lbl / markerchar = Trt1cnt x2axis;
scatter y = subgroup x = trt2_lbl / markerchar = Trt2cnt x2axis;
scatter y = subgroup x = or_lbl / markerchar = OddRatio x2axis;
scatter y = subgroup x = pval_lbl / markerchar = pvalue x2axis;
refline 1 5 / axis = x;
inset ' Favors Treatment' / position = bottomleft;
inset 'Favors Control ' / position = bottom;
xaxis type = log offsetmin = 0.02 offsetmax = 0.35
min = 0.05 max = 20 minor display = (nolabel) grid;
x2axis offsetmin = 0.7 display = (noticks nolabel) offsetmax = 0.05;
yaxis display = (noticks nolabel) offsetmin = 0.02 offsetmax = 0.02;
05-19-2014 10:33 PM
Without a sample of YOUR data, it's impossible to understand what you mean. My suggestion is that you post this question, with code and data over in the ODS Graphics forum. Sanjay will look at and answer questions that are posted over there, and since he is the author of all the FOREST plot examples that I know of, he's the expert in this area.
05-20-2014 10:58 AM
One of the classic ways is to add a value in each sub group with an associated y value of missing or zero. Playing some games with the value formats to indicate a blank or possibly just a vertical line to indicate a spacer is often possible. Just make sure that the added subgroup value is either last or first in value.
05-20-2014 11:37 AM
I did try that approach by plugging in a blank record after each subgroup, but I was not able to get that extra blank (Maybe because the oddsratio, which I was trying to plot is missing).