<?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: How to combine categorical and distributional plots in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374522#M12928</link>
    <description>&lt;P&gt;This can be done using sgplot, but you must use a BARPARM instead of a BAR. This also means that you will need to pre-summarize the bar statistics. Here are a couple of examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class nway;
class age;
var weight;
output out=meanwgt mean=meanwgt;
run;

data merged;
merge meanwgt(rename=(age=age1)) sashelp.class;
run;

proc sgplot data=merged;
vbarparm category=age1 response=meanwgt;
vbox height / category=age y2axis fillattrs=(color=red);
run;

proc sgplot data=merged;
vbarparm category=age1 response=meanwgt / barwidth=0.4 discreteoffset=-0.2;
vbox height / category=age y2axis fillattrs=(color=red) boxwidth=0.4 discreteoffset=0.2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2017 14:27:03 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2017-07-10T14:27:03Z</dc:date>
    <item>
      <title>How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373784#M12918</link>
      <description>&lt;P&gt;I'd like to overlay boxplots (y2axis) on bar plots (yaxis). These 2 plot types are not compatible in sgplot. What are my options?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 21:42:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373784#M12918</guid>
      <dc:creator>pstack</dc:creator>
      <dc:date>2017-07-06T21:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373794#M12919</link>
      <description>&lt;P&gt;Can you show an example of what you're trying to accomplish?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can look into custom plots using GTL and note that you can use TMPLOUT option on PROC SGPLOT to generate the base statements for you to get started.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=grstatproc&amp;amp;docsetTarget=p073bl97jzadkmn15lhq58yiy2uh.htm&amp;amp;locale=en#n086387n9y3ct3n1i9djru01fomy" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=grstatproc&amp;amp;docsetTarget=p073bl97jzadkmn15lhq58yiy2uh.htm&amp;amp;locale=en#n086387n9y3ct3n1i9djru01fomy&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/113002"&gt;@pstack&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I'd like to overlay boxplots (y2axis) on bar plots (yaxis). These 2 plot types are not compatible in sgplot. What are my options?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 23:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373794#M12919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-06T23:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373971#M12920</link>
      <description>&lt;P&gt;Thank you for pointing me in the right direction. I had never used GTL but it was the solution. In short order I made the plot shown below which is what I wanted. This particular version of the plot is not very enlightening but in some circumstances it nicely displays that detection frequencies and concentration distributions vary significantly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/14048i5ACEEDB9B3CB2414/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SGRender41.png" title="SGRender41.png" /&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/373971#M12920</guid>
      <dc:creator>pstack</dc:creator>
      <dc:date>2017-07-07T13:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374522#M12928</link>
      <description>&lt;P&gt;This can be done using sgplot, but you must use a BARPARM instead of a BAR. This also means that you will need to pre-summarize the bar statistics. Here are a couple of examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=sashelp.class nway;
class age;
var weight;
output out=meanwgt mean=meanwgt;
run;

data merged;
merge meanwgt(rename=(age=age1)) sashelp.class;
run;

proc sgplot data=merged;
vbarparm category=age1 response=meanwgt;
vbox height / category=age y2axis fillattrs=(color=red);
run;

proc sgplot data=merged;
vbarparm category=age1 response=meanwgt / barwidth=0.4 discreteoffset=-0.2;
vbox height / category=age y2axis fillattrs=(color=red) boxwidth=0.4 discreteoffset=0.2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374522#M12928</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-07-10T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374537#M12929</link>
      <description>&lt;P&gt;Thanks Dan. I copied and pasted your example code into SAS but still got the "incompatible plot types" error messages. Below is a snippet from the log showing that the data was read in...but the plots could not be made:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: There were 6 observations read from the data set WORK.MEANWGT.&lt;/P&gt;&lt;P&gt;NOTE: There were 19 observations read from the data set SASHELP.CLASS.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.MERGED has 19 observations and 9 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;11 proc sgplot data=merged;&lt;/P&gt;&lt;P&gt;12 vbarparm category=age1 response=meanwgt;&lt;/P&gt;&lt;P&gt;13 vbox height / category=age y2axis fillattrs=(color=red);&lt;/P&gt;&lt;P&gt;14 run;&lt;/P&gt;&lt;P&gt;NOTE: Writing HTML Body file: sashtml.htm&lt;/P&gt;&lt;P&gt;ERROR: Attempting to overlay incompatible plot or chart types.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SGPLOT used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.17 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.10 seconds&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;16 proc sgplot data=merged;&lt;/P&gt;&lt;P&gt;17 vbarparm category=age1 response=meanwgt / barwidth=0.4 discreteoffset=-0.2;&lt;/P&gt;&lt;P&gt;18 vbox height / category=age y2axis fillattrs=(color=red) boxwidth=0.4 discreteoffset=0.2;&lt;/P&gt;&lt;P&gt;19 run;&lt;/P&gt;&lt;P&gt;ERROR: Attempting to overlay incompatible plot or chart types.&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SGPLOT used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374537#M12929</guid>
      <dc:creator>pstack</dc:creator>
      <dc:date>2017-07-10T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374544#M12930</link>
      <description>&lt;P&gt;What version of SAS are you using?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374544#M12930</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-07-10T14:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374545#M12931</link>
      <description>&lt;P&gt;Support for this type of overlay was added starting with 9.4, maintenance 1.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 14:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374545#M12931</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2017-07-10T14:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374546#M12932</link>
      <description>&lt;P&gt;SAS 9.4&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 15:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374546#M12932</guid>
      <dc:creator>pstack</dc:creator>
      <dc:date>2017-07-10T15:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine categorical and distributional plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374552#M12933</link>
      <description>&lt;P&gt;That must be it. I don't see anything about maintenance level:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.4 TS Level 1M0&lt;/P&gt;&lt;P&gt;X64_7PRO platform&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a work around for this using Proc Template and assigning and sorting the x-axis with a numeric thanks to previous responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help. -Paul&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2017 15:06:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-combine-categorical-and-distributional-plots/m-p/374552#M12933</guid>
      <dc:creator>pstack</dc:creator>
      <dc:date>2017-07-10T15:06:08Z</dc:date>
    </item>
  </channel>
</rss>

