<?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: Editing labels on Forest Plot in SGPlot and reordering variables in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736252#M21404</link>
    <description>FYI - I moved your post to the graphics forum, which is more appropriate for your question. It would be helpful if you could provide some data to work with as well, or use one of the examples from the blog posts as a starting point so it's easier to someone to help out. &lt;BR /&gt;&lt;BR /&gt;Can't really run your code without data, fake data is totally fine. &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/?s=forest+plot" target="_blank"&gt;https://blogs.sas.com/content/?s=forest+plot&lt;/A&gt;</description>
    <pubDate>Wed, 21 Apr 2021 20:50:54 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-04-21T20:50:54Z</dc:date>
    <item>
      <title>Editing labels on Forest Plot in SGPlot and reordering variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736250#M21403</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't used SGPLOT aside from the very basics. I have a Forest plot for which I would like to edit the labels. I would also like to reorder the variables so they match the order in the odds ratio table. In my example below, I would like to remove the variables names "Race_new" and "Sex" but keep "Age". I would also like to put "Age" in top followed by "Sex" and then "Race". I've been scouring SAS resources but I can't seem to find anything to address these questions specifically.&amp;nbsp; My code can be found below. Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joesmama_0-1619037563001.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58600i5E2F0CF179CEDAE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joesmama_0-1619037563001.png" alt="joesmama_0-1619037563001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;proc sgplot data=orci_a;&lt;BR /&gt;scatter x=oddsratioest y=effect / xerrorlower=lowercl&lt;BR /&gt;xerrorupper=uppercl&lt;BR /&gt;markerattrs=or&lt;BR /&gt;(symbol=DiamondFilled size=8);&lt;BR /&gt;refline 1 / axis=x;&lt;/P&gt;
&lt;P&gt;xaxis label="OR and 95% CI " min=0;&lt;BR /&gt;yaxis label="Covariates";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 20:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736250#M21403</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-04-21T20:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Editing labels on Forest Plot in SGPlot and reordering variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736252#M21404</link>
      <description>FYI - I moved your post to the graphics forum, which is more appropriate for your question. It would be helpful if you could provide some data to work with as well, or use one of the examples from the blog posts as a starting point so it's easier to someone to help out. &lt;BR /&gt;&lt;BR /&gt;Can't really run your code without data, fake data is totally fine. &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/?s=forest+plot" target="_blank"&gt;https://blogs.sas.com/content/?s=forest+plot&lt;/A&gt;</description>
      <pubDate>Wed, 21 Apr 2021 20:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736252#M21404</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-21T20:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Editing labels on Forest Plot in SGPlot and reordering variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736256#M21405</link>
      <description>&lt;P&gt;If you check your data I suspect that you find your Effect variable has values like "race_new Other vs White" as text.&lt;/P&gt;
&lt;P&gt;Which means that you either take pass through a data step and modify the text for the effect variable as desired or create a format from the values you have to display "Other vs White" instead of "race_new Other vs White".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the current axis display order is using the alphabetical values you likely want to make the changes above and then see the result.&lt;/P&gt;
&lt;P&gt;The YAXIS option Reverse would display the values alphabetically with the "top" of the Y axis as Age and and ascending alphabetical from there.&lt;/P&gt;
&lt;P&gt;Or use an explicit values list such as:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class;
   where name in ("Alfred"  "Carol" "Janet" "Robert" );
   scatter x=age y=name ;
   yaxis values=   ("Janet" "Robert" "Carol" "Alfred");
   /*the first value appears next to the Xaxis the last value furthest from x*/
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Apr 2021 21:13:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736256#M21405</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-21T21:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Editing labels on Forest Plot in SGPlot and reordering variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736292#M21406</link>
      <description>&lt;P&gt;Brilliant! I can't believe I didn't think of that. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 23:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Editing-labels-on-Forest-Plot-in-SGPlot-and-reordering-variables/m-p/736292#M21406</guid>
      <dc:creator>joesmama</dc:creator>
      <dc:date>2021-04-21T23:23:33Z</dc:date>
    </item>
  </channel>
</rss>

