<?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: Plotting a Rate on the Y-Axis in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91217#M3378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It partly depends on what version of SAS you have. Depending on your data you may want to add a group variable, but again hard to comment without knowing exactly what your data looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my 9.2 solution that uses proc freq to get my percentages and then uses VBAR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.class;&lt;/P&gt;&lt;P&gt;table sex*age/out=summary1 outpct;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data graph_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set summary1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where sex='F';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep sex age pct_col;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pct_col=pct_col/100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format pct_col percent8.1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=graph_data;&lt;/P&gt;&lt;P&gt; vbar age /stat=sum response=pct_col;&lt;/P&gt;&lt;P&gt;run; quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jul 2013 21:27:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-07-25T21:27:03Z</dc:date>
    <item>
      <title>Plotting a Rate on the Y-Axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91216#M3377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a plot where I have categories in the x-axis (e.g. race, region, etc.) and the rate of an event (e.g. death,) of a binary response variable on the y-axis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To me this almost seems like plotting the row percent for the "event occured" column in na Rx2 frequency table. &lt;/P&gt;&lt;P&gt;If anyone can give me some guidance on how to best go about this, I would really appreciate it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 20:49:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91216#M3377</guid>
      <dc:creator>rhysticlight</dc:creator>
      <dc:date>2013-07-25T20:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting a Rate on the Y-Axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91217#M3378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It partly depends on what version of SAS you have. Depending on your data you may want to add a group variable, but again hard to comment without knowing exactly what your data looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my 9.2 solution that uses proc freq to get my percentages and then uses VBAR. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=sashelp.class;&lt;/P&gt;&lt;P&gt;table sex*age/out=summary1 outpct;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data graph_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set summary1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where sex='F';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep sex age pct_col;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pct_col=pct_col/100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; format pct_col percent8.1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sgplot data=graph_data;&lt;/P&gt;&lt;P&gt; vbar age /stat=sum response=pct_col;&lt;/P&gt;&lt;P&gt;run; quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 21:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91217#M3378</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-25T21:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting a Rate on the Y-Axis</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91218#M3379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for your help! I am using SAS 9.3 so I will give that a try and see how it goes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I basically have a variable age that I have grouped into ranges using a format statement, and I would like to have a plot of age group on the x-axis vs. mortality rate in that group on the y-axis. So my code for producing a frequency table (without output) would look something like:&lt;/P&gt;&lt;P&gt;proc freq data=work.temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables age*dead_yn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format age age_groups.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give this a try and let you know how it works out! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 00:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plotting-a-Rate-on-the-Y-Axis/m-p/91218#M3379</guid>
      <dc:creator>rhysticlight</dc:creator>
      <dc:date>2013-07-26T00:56:31Z</dc:date>
    </item>
  </channel>
</rss>

