<?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: sgplot with Multiple variables on vbar in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/389434#M13342</link>
    <description>&lt;P&gt;You can use PROC TRANSPOSE. &amp;nbsp;&lt;SPAN&gt;if you have data set "Response" with Cat, Response1 and Response2, you can use the following. &amp;nbsp;The response column names will show up as group values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=response out=groups;
  by cat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a simple case like yours, I use a simple data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data groups;
  keep Cat Group Response;
  set response;
  Group=1; Response=response1; output;
  Group=2; Response=response2; output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is an &lt;A href="http://blogs.sas.com/content/iml/2011/01/31/reshaping-data-from-wide-to-long-format.html" target="_blank"&gt;article by Rick&lt;/A&gt; on this topic.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2017 01:21:11 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2017-08-21T01:21:11Z</dc:date>
    <item>
      <title>sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/388772#M13323</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=pande_app4_w_bad;

vbar Selskapspolicy / response=Bad_6m stat=mean DATALABEL
barwidth=0.6 fillattrs=graphdata1 ;
  yaxis grid display=(nolabel);
  xaxis display=(nolabel);


vbar Selskapspolicy / response=Bad_12m stat=mean DATALABEL
barwidth=0.4 fillattrs=graphdata2 ;
  yaxis grid display=(nolabel);
  xaxis display=(nolabel);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/14535iC3E23A5267B5AE5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not getting this as neat as I want to side by side...Anyone?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 13:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/388772#M13323</guid>
      <dc:creator>Kiteulf</dc:creator>
      <dc:date>2017-08-17T13:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/388807#M13324</link>
      <description>&lt;P&gt;If you want the blue and red bars to be placed side by side, you have two options.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2011/11/10/it-pays-to-be-discrete/" target="_blank"&gt;DISCRETEOFFSET&lt;/A&gt;. &amp;nbsp;Reduce both bar widths, and use discreteoffset=-0.2 with one and &lt;SPAN&gt;discreteoffset=+0.2&lt;/SPAN&gt;&amp;nbsp;with other. &amp;nbsp;You can adjust the widths and offsets to suit.&lt;/LI&gt;
&lt;LI&gt;Change your data set from 2 response columns to one response column with a classifier. &amp;nbsp;Then you can use the GROUP option with GROUPDISPLAY=&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2012/03/30/cluster-groups/" target="_blank"&gt;CLUSTER &lt;/A&gt;to get side by side bars. &amp;nbsp;This way is more scalable and preferable.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 17 Aug 2017 14:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/388807#M13324</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-08-17T14:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/389046#M13330</link>
      <description>&lt;P&gt;Yeah I want to use the Group option, but found it hard to implement as my data is of the type&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="2" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;reponsecolumn1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;responsecolumn2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;0&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" style="height: 15.0pt;"&gt;1&lt;/TD&gt;
&lt;TD align="right"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I get it to a one response column and a classifier?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 06:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/389046#M13330</guid>
      <dc:creator>Kiteulf</dc:creator>
      <dc:date>2017-08-18T06:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with Multiple variables on vbar</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/389434#M13342</link>
      <description>&lt;P&gt;You can use PROC TRANSPOSE. &amp;nbsp;&lt;SPAN&gt;if you have data set "Response" with Cat, Response1 and Response2, you can use the following. &amp;nbsp;The response column names will show up as group values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=response out=groups;
  by cat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a simple case like yours, I use a simple data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data groups;
  keep Cat Group Response;
  set response;
  Group=1; Response=response1; output;
  Group=2; Response=response2; output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is an &lt;A href="http://blogs.sas.com/content/iml/2011/01/31/reshaping-data-from-wide-to-long-format.html" target="_blank"&gt;article by Rick&lt;/A&gt; on this topic.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 01:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sgplot-with-Multiple-variables-on-vbar/m-p/389434#M13342</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-08-21T01:21:11Z</dc:date>
    </item>
  </channel>
</rss>

