<?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: Graphing Yes only by group in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253217#M9175</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45253"&gt;@Tpham﻿&lt;/a&gt;&amp;nbsp;The percents are not impacted because there is only 1 value for each column and if you take the mean or sum of a single number the value is the single number so it graphs the way you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially you're pre-calculating your values and using the above logic to produce your graph.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The example from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks﻿&lt;/a&gt;&amp;nbsp;demonstrates this, though you'll need to customize the plot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Feb 2016 15:55:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-02-29T15:55:07Z</dc:date>
    <item>
      <title>Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253196#M9165</link>
      <description>&lt;P&gt;I am trying create a graph that shows the row percent only for 2 groups and within the graph show 2-3 variables.. How do I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created an example in Excel which is attached as an image. I am hoping to do this in SAS, since I have a lot of graphs to create and also want to avoid copying and pasting numbers (so don't want any human error).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the raw data, so I will need to use proc freq to compute the percentages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2091iE469E168BA123371/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="screen.jpg" title="screen.jpg" /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12327iE7EC93144F535074/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="screen.jpg" title="screen.jpg" /&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253196#M9165</guid>
      <dc:creator>Tpham</dc:creator>
      <dc:date>2016-02-29T15:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253198#M9166</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What version of SAS do you have please? Can you provide the raw data or the data of the percentages please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253198#M9166</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-02-29T15:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253200#M9167</link>
      <description>&lt;P&gt;SAS 9.2, I can't provide the raw dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for the general approach I should use so I can code this myself.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253200#M9167</guid>
      <dc:creator>Tpham</dc:creator>
      <dc:date>2016-02-29T15:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253202#M9168</link>
      <description>&lt;P&gt;Well, the simplest way would be to have a datastep before it which drops the No data, then its just a barchart by group.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, a stacked barchart, with the no group given color white would also work. &amp;nbsp;You can find many examples of all types of graphs here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/?s=stacked" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/?s=stacked&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I have filtered for stacked, but there are many examples.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:27:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253202#M9168</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-29T15:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253205#M9169</link>
      <description>&lt;P&gt;If I drop the No data, wouldn't the % be impacted?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I want the percentages of "Yes" within the variable for that group...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way I can make SAS create a bar graph of just numbers? I am thinking if I can use proc freq with an out= option and keep only the percentage of yes within that dataset and graph that?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253205#M9169</guid>
      <dc:creator>Tpham</dc:creator>
      <dc:date>2016-02-29T15:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253206#M9170</link>
      <description>&lt;P&gt;Okay, here is an example then. I agree with RW9 too, you need to drop the No data before you plot the graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;&amp;nbsp; input var$ group$ response$ result;&lt;BR /&gt;&amp;nbsp; cards;&lt;BR /&gt;&amp;nbsp; var1 group1 yes 0.7&lt;BR /&gt;&amp;nbsp; var1 group2 yes 0.75&lt;BR /&gt;&amp;nbsp; var1 group1 no 0.3&lt;BR /&gt;&amp;nbsp; var1 group2 no 0.25&lt;BR /&gt;&amp;nbsp; var2 group1 yes 0.35&lt;BR /&gt;&amp;nbsp; var2 group2 yes 0.2&lt;BR /&gt;&amp;nbsp; var2 group1 no 0.65&lt;BR /&gt;&amp;nbsp; var2 group2 no 0.8&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc sgpanel data = test;&lt;BR /&gt;&amp;nbsp; where response = "yes";&lt;BR /&gt;&amp;nbsp; panelby var;&lt;BR /&gt;&amp;nbsp; vbar group / response = result group = response stat= mean;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253206#M9170</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-02-29T15:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253207#M9171</link>
      <description>&lt;P&gt;You can calculate the percentages using all the data, and then drop the "No data" before you produce the barchart.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:40:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253207#M9171</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2016-02-29T15:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253210#M9172</link>
      <description>&lt;P&gt;So what does your data look like, I assumed from what you had posted you already had percentages, but from the below, you seem to be calculating percentage from data. &amp;nbsp;Can you clarify what your data looks like, if you already have the percentages then&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks﻿&lt;/a&gt;&amp;nbsp;solution should work.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253210#M9172</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-29T15:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253213#M9173</link>
      <description>&lt;P&gt;So my data looks something like this (sample data, not actual). where 1=yes and 2=no and then a group variable 1/2. All these have formats (so var, yes/no and group with group names)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/2094iDD7DE77228669BCC/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="screen.jpg" title="screen.jpg" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in this case, I want to calculate the row percentage of each variable for each group and then graph only the %yes&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The percentage that I have calculated in my excel graph example would be from the proc freq results. I have about 200 vars, of course now 200 variables would be on one graph). So I am wondering is there a way to streamline/automate this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253213#M9173</guid>
      <dc:creator>Tpham</dc:creator>
      <dc:date>2016-02-29T15:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253215#M9174</link>
      <description>&lt;P&gt;What about this one - it uses GCHART but allows for groups and subgroups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd7/col1.htm" target="_blank"&gt;http://robslink.com/SAS/democd7/col1.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd7/col1.sas" target="_blank"&gt;http://robslink.com/SAS/democd7/col1.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:52:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253215#M9174</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-29T15:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Yes only by group</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253217#M9175</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45253"&gt;@Tpham﻿&lt;/a&gt;&amp;nbsp;The percents are not impacted because there is only 1 value for each column and if you take the mean or sum of a single number the value is the single number so it graphs the way you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially you're pre-calculating your values and using the above logic to produce your graph.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The example from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks﻿&lt;/a&gt;&amp;nbsp;demonstrates this, though you'll need to customize the plot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 15:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Graphing-Yes-only-by-group/m-p/253217#M9175</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-29T15:55:07Z</dc:date>
    </item>
  </channel>
</rss>

