<?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 Re: Simple forest plot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791748#M253660</link>
    <description>Change XERRORLOWER to YERRORLOWER?&lt;BR /&gt;&lt;BR /&gt;I think that doesn't make sense though as scale is along the x axis so how would the Y axis also be the same scale?</description>
    <pubDate>Mon, 24 Jan 2022 00:37:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-01-24T00:37:20Z</dc:date>
    <item>
      <title>Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/766982#M243085</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Could someone please share SAS code to make a simple forest plot out of this (two studies go on the y axis):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forest;                                                                                                                            
   input Study $1-16 OddsRatio LowerCL UpperCL;                                                                              
   format oddsratio lowercl uppercl 5.3;                                                                                                                                                                                       
datalines;                                                                                                                              
Modano  (1967)    0.590 0.096 3.634                                                                                              
Borodan (1981)    0.464 0.201 1.074                                                                                                                                                                                     
;   
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 22:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/766982#M243085</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2021-09-09T22:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/766986#M243088</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forest;                                                                                                                            
   input Study $1-16 OddsRatio LowerCL UpperCL;                                                                              
   format oddsratio lowercl uppercl 5.3;                                                                                                                                                                                       
datalines;                                                                                                                              
Modano  (1967)    0.590 0.096 3.634                                                                                              
Borodan (1981)    0.464 0.201 1.074                                                                                                                                                                                     
;   
run; 


title "Odds Ratios with 95% Wald Confidence Limits";
proc sgplot data=forest noautolegend;
   scatter y=Study x=oddsratio / xerrorlower=LowerCL xerrorupper=UpperCL
           markerattrs=(symbol=diamondfilled);
   refline 1 / axis=x;
  * xaxis grid type=log label="Odds Ratio (log scale)";  /* specify log scale */
  * yaxis grid display=(nolabel) discreteorder=data reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Based on this post, but I commented out the log scale axis.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/07/29/or-plots-log-scale.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/07/29/or-plots-log-scale.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quite a few more complicated examples with data and code on the SAS blogs.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2012/02/01/forest-plot-using-sgplot-procedure/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2012/02/01/forest-plot-using-sgplot-procedure/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235176"&gt;@pink_poodle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Could someone please share SAS code to make a simple forest plot out of this (two studies go on the y axis):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forest;                                                                                                                            
   input Study $1-16 OddsRatio LowerCL UpperCL;                                                                              
   format oddsratio lowercl uppercl 5.3;                                                                                                                                                                                       
datalines;                                                                                                                              
Modano  (1967)    0.590 0.096 3.634                                                                                              
Borodan (1981)    0.464 0.201 1.074                                                                                                                                                                                     
;   
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 23:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/766986#M243088</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-09T23:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767096#M243153</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for a simple and elegant solution. I have just one follow-up question, I would like population numbers as a secondary y-axis on a graph like this (please also see image below):&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Study&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; N&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Modano (1967)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;
&lt;P&gt;Borodan (1981)&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200&lt;/P&gt;
&lt;P&gt;How would you modify the code to accommodate the N variable?:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data forest;                                                                                                                            
   input Study $1-16 N OddsRatio LowerCL UpperCL;                                                                              
   format oddsratio lowercl uppercl 5.3;                                                                                                                                                                                       
datalines;                                                                                                                              
Modano  (1967)    100 0.590 0.096 3.634                                                                                              
Borodan (1981)    200 0.464 0.201 1.074                                                                                                                                                                                     
;   
run; 

title "Odds Ratios with 95% Wald Confidence Limits";
proc sgplot data=forest noautolegend;
   scatter y=Study x=oddsratio / xerrorlower=LowerCL xerrorupper=UpperCL
           markerattrs=(symbol=diamondfilled);
   refline 1 / axis=x;
  * xaxis grid type=log label="Odds Ratio (log scale)";  /* specify log scale */
  * yaxis grid display=(nolabel) discreteorder=data reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="forest plot.png" style="width: 729px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63497i41BC540473AA9F1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="forest plot.png" alt="forest plot.png" /&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 18:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767096#M243153</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2021-09-10T18:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767107#M243157</link>
      <description>Several of the examples in the blog posts have this feature, have you tried using any of the code examples from there?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 10 Sep 2021 19:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767107#M243157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-10T19:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767135#M243165</link>
      <description>&lt;P&gt;I can put population numbers in columns to the right, but am not sure which part of code is responsible for those columns&lt;/P&gt;
&lt;P&gt;(&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/files/2012/02/Full-SAS-93-Code.txt" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/graphicallyspeaking/files/2012/02/Full-SAS-93-Code.txt)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pink_poodle_0-1631307218979.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63509iD2D852FF5D766F3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pink_poodle_0-1631307218979.png" alt="pink_poodle_0-1631307218979.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*--Set up columns to create the stat tables--*/
  OR='OR'; LCL='LCL'; UCL='UCL'; WT='Weight';

  datalines;
Modano  (1967)    1  0.590 0.096 3.634  1
Borodan (1981)    1  0.464 0.201 1.074  3.5
Leighton (1972)   1  0.394 0.076 2.055  2
Novak   (1992)    1  0.490 0.088 2.737  2
Stawer  (1998)    1  1.250 0.479 3.261  3
Truark   (2002)   1  0.129 0.027 0.605  2.5
Fayney   (2005)   1  0.313 0.054 1.805  2
Modano  (1969)    1  0.429 0.070 2.620  2
Soloway (2000)    1  0.718 0.237 2.179  3
Adams   (1999)    1  0.143 0.082 0.250  4
Truark2  (2002)   1  0.129 0.027 0.605  2.5
Fayney2  (2005)   1  0.313 0.054 1.805  2
Modano2 (1969)    1  0.429 0.070 2.620  2
Soloway2(2000)    1  0.718 0.237 2.179  3
Adams2   (1999)   1  0.143 0.082 0.250  4
Overall           2  0.328 0.233 0.462  .
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Sep 2021 20:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767135#M243165</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2021-09-10T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767432#M243300</link>
      <description>Then you try them one by one and see which does what.</description>
      <pubDate>Mon, 13 Sep 2021 14:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767432#M243300</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-13T14:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767458#M243314</link>
      <description>Sequential inactivation, yes :). I decided why not stretch a table next to a graph instead. It will look just as good.</description>
      <pubDate>Mon, 13 Sep 2021 16:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767458#M243314</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2021-09-13T16:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767473#M243323</link>
      <description>The code comments are pretty clear to me to be honest. &lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2021 16:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/767473#M243323</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-13T16:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791715#M253638</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;,&lt;BR /&gt;I have a quick follow-up question:&lt;BR /&gt;Is there a way to make xerrorlower and xerrorupper (i.e., odds ratio) values to appear above the tick marks?&lt;BR /&gt;Many thanks!</description>
      <pubDate>Sun, 23 Jan 2022 16:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791715#M253638</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-01-23T16:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791720#M253642</link>
      <description>&lt;PRE&gt;*Here is one way of doing it;&lt;BR /&gt;&lt;CODE class=" language-sas"&gt;title "Odds Ratios with 95% Wald Confidence Limits";
proc sgplot data=forest noautolegend;
   scatter y=Study x=oddsratio / xerrorlower=LowerCL xerrorupper=UpperCL
           markerattrs=(symbol=diamondfilled) datalabel=oddsratio
           datalabelattrs=(weight=bold);
   scatter y=study x=lowercl / datalabel = lowercl markerattrs=(size=0 color=crimson);
   scatter y=study x=uppercl / datalabel = uppercl markerattrs=(size=0 color=crimson);
   refline 1 / axis=x;
  * xaxis grid type=log label="Odds Ratio (log scale)";  
   /* specify log scale */
  * yaxis grid display=(nolabel) discreteorder=data reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jan 2022 17:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791720#M253642</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-01-23T17:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791748#M253660</link>
      <description>Change XERRORLOWER to YERRORLOWER?&lt;BR /&gt;&lt;BR /&gt;I think that doesn't make sense though as scale is along the x axis so how would the Y axis also be the same scale?</description>
      <pubDate>Mon, 24 Jan 2022 00:37:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791748#M253660</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-24T00:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791948#M253749</link>
      <description>&lt;P&gt;The output looks right:&lt;/P&gt;
&lt;DIV style="padding-top: 1px; padding-bottom: 8px;"&gt;
&lt;DIV id="IDX" class="systitleandfootercontainer" style="border-spacing: 1px;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV style="padding-top: 1px; padding-bottom: 8px;"&gt;
&lt;DIV class="c"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pink_poodle_0-1643049359038.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67683i3B262DC8094FBC9A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pink_poodle_0-1643049359038.png" alt="pink_poodle_0-1643049359038.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Jan 2022 18:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791948#M253749</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-01-24T18:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791949#M253750</link>
      <description>That shows error bars along the X axis only, no Y axis error bars.</description>
      <pubDate>Mon, 24 Jan 2022 18:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791949#M253750</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-24T18:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple forest plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791950#M253751</link>
      <description>Update: Are you asking for datalabels for the error bars? If so, looks like you've got that solved. &lt;BR /&gt;If there isn't an option within Scatter you could use TEXT statements to plot those.</description>
      <pubDate>Mon, 24 Jan 2022 18:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-forest-plot/m-p/791950#M253751</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-24T18:40:11Z</dc:date>
    </item>
  </channel>
</rss>

