<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need Help Coding Grouped Forest Plot in SAS in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926953#M24587</link>
    <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;
&lt;P&gt;I've been trying to create a grouped forest plot in SAS, but so far, I've only been able to find resources on how to create a single forest plot. However, my requirement is to combine two forest plots into one, similar to the attached sample plot.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="41467_2023_42581_Fig6_HTML.png" style="width: 685px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96158i4DB8CD29630CD1E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="41467_2023_42581_Fig6_HTML.png" alt="41467_2023_42581_Fig6_HTML.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering if anyone could offer some guidance on how to achieve this. Should I use &lt;CODE&gt;proc sgplot&lt;/CODE&gt; or &lt;CODE&gt;proc template&lt;/CODE&gt; for this purpose? Currently, I'm using the &lt;CODE&gt;proc sgplot&lt;/CODE&gt; code provided in this post: &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/05/30/ctspedia-clinical-graphs-subgrouped-forest-plot/" target="_new" rel="noreferrer"&gt;CTSPedia Clinical Graphs - Subgrouped Forest Plot&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Any insights or examples you could share would be greatly appreciated!&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Jess&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 22:07:47 GMT</pubDate>
    <dc:creator>YYK273</dc:creator>
    <dc:date>2024-05-03T22:07:47Z</dc:date>
    <item>
      <title>Need Help Coding Grouped Forest Plot in SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926953#M24587</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;
&lt;P&gt;I've been trying to create a grouped forest plot in SAS, but so far, I've only been able to find resources on how to create a single forest plot. However, my requirement is to combine two forest plots into one, similar to the attached sample plot.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="41467_2023_42581_Fig6_HTML.png" style="width: 685px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96158i4DB8CD29630CD1E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="41467_2023_42581_Fig6_HTML.png" alt="41467_2023_42581_Fig6_HTML.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering if anyone could offer some guidance on how to achieve this. Should I use &lt;CODE&gt;proc sgplot&lt;/CODE&gt; or &lt;CODE&gt;proc template&lt;/CODE&gt; for this purpose? Currently, I'm using the &lt;CODE&gt;proc sgplot&lt;/CODE&gt; code provided in this post: &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/05/30/ctspedia-clinical-graphs-subgrouped-forest-plot/" target="_new" rel="noreferrer"&gt;CTSPedia Clinical Graphs - Subgrouped Forest Plot&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Any insights or examples you could share would be greatly appreciated!&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;Jess&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 22:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926953#M24587</guid>
      <dc:creator>YYK273</dc:creator>
      <dc:date>2024-05-03T22:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Coding Grouped Forest Plot in SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926970#M24589</link>
      <description>&lt;P&gt;That is what PROC SGPANEL supposed to do .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(123);
do year=1 to 2;
 do id=1 to 10;
   if id=1 then new_id=1;
    else if id in (2:4) then new_id=2;
	 else  if id=5 then new_id=5;
      else  if id=6 then new_id=6;
	   else if id in (7:8) then new_id=7;
         else new_id=id;

   mean=rand('uniform',-0.1,0.1);
   error=rand('uniform',-0.05,0.05);
   lower=mean-error;
   upper=mean+error;
   output;
 end;
end;
run;
proc sgpanel data=have;
panelby year;
scatter x=mean y=id/xerrorlower=lower xerrorupper=upper;
rowaxis type=discrete offsetmin=0.05 offsetmax=0.05 ;
refline 0/axis=x lineattrs=(pattern=dash);
refline new_id/axis=y discreteoffset=0.5;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1714787825098.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96166i293ABBCEA3FFD6B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1714787825098.png" alt="Ksharp_0-1714787825098.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 01:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926970#M24589</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-04T01:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Coding Grouped Forest Plot in SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926977#M24590</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(123);
do year=1 to 2;
 do id=1 to 10;
     if id in (3:4  6 8 10) then new_id=id;
	  else new_id=.;

   mean=rand('uniform',-0.1,0.1);
   error=rand('uniform',-0.05,0.05);
   lower=mean-error;
   upper=mean+error;
   output;
 end;
end;
run;
proc sgpanel data=have ;
panelby year/spacing=0;
scatter x=mean y=id/xerrorlower=lower xerrorupper=upper;
rowaxis type=discrete offsetmin=0.05 offsetmax=0.05 ;
refline 0/axis=x lineattrs=(pattern=dash);
refline new_id/axis=y lineattrs=(thickness=40) transparency=0.8;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1714793592979.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96167i8699D37C955DDE51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1714793592979.png" alt="Ksharp_0-1714793592979.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 03:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Need-Help-Coding-Grouped-Forest-Plot-in-SAS/m-p/926977#M24590</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-05-04T03:33:41Z</dc:date>
    </item>
  </channel>
</rss>

