<?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 Boxplot grouping in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75492#M2802</link>
    <description>Hi all&lt;BR /&gt;
&lt;BR /&gt;
I am trying to create what I believe to be a relatively simple set of boxplots.  I want to be able to group the x-axis by certain variables.  Then the legend should show the differences.&lt;BR /&gt;
&lt;BR /&gt;
For example.&lt;BR /&gt;
&lt;BR /&gt;
I am plotting the "number of errors" on the y-axis vs 2 variables on the x.  First one being "Test_Time_bin" and second being "Substrate"  The number of values for both Test_Time and Substrate will change for every dataset I am going to plot so I cannot hard code anything.  For each value of "Test_Time_Bin" I want multiple boxplots (side by side) for each value of "Substrate".&lt;BR /&gt;
&lt;BR /&gt;
I have searched around and haven't had any luck with finding example code.  I did find a picture of the exact thing I want to do for reference.  Figure 2 at this link:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.information-management.com/issues/20050801/1033566-1.html" target="_blank"&gt;http://www.information-management.com/issues/20050801/1033566-1.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Hope I am explaining enough here.&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
    <pubDate>Thu, 15 Apr 2010 21:31:33 GMT</pubDate>
    <dc:creator>GDA</dc:creator>
    <dc:date>2010-04-15T21:31:33Z</dc:date>
    <item>
      <title>Boxplot grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75492#M2802</link>
      <description>Hi all&lt;BR /&gt;
&lt;BR /&gt;
I am trying to create what I believe to be a relatively simple set of boxplots.  I want to be able to group the x-axis by certain variables.  Then the legend should show the differences.&lt;BR /&gt;
&lt;BR /&gt;
For example.&lt;BR /&gt;
&lt;BR /&gt;
I am plotting the "number of errors" on the y-axis vs 2 variables on the x.  First one being "Test_Time_bin" and second being "Substrate"  The number of values for both Test_Time and Substrate will change for every dataset I am going to plot so I cannot hard code anything.  For each value of "Test_Time_Bin" I want multiple boxplots (side by side) for each value of "Substrate".&lt;BR /&gt;
&lt;BR /&gt;
I have searched around and haven't had any luck with finding example code.  I did find a picture of the exact thing I want to do for reference.  Figure 2 at this link:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://www.information-management.com/issues/20050801/1033566-1.html" target="_blank"&gt;http://www.information-management.com/issues/20050801/1033566-1.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Hope I am explaining enough here.&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Thu, 15 Apr 2010 21:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75492#M2802</guid>
      <dc:creator>GDA</dc:creator>
      <dc:date>2010-04-15T21:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75493#M2803</link>
      <description>With traditional SAS/Graph "proc gchart", you can do grouped bar charts, and turn on the 'errorbar' on each bar, and get something a little bit similar (not exactly what you're wanting though).  For example:&lt;BR /&gt;
&lt;BR /&gt;
axis1 value=(angle=90);&lt;BR /&gt;
pattern1 v=s c=yellow;&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=sashelp.revhub2;&lt;BR /&gt;
vbar type / type=mean sumvar=revenue errorbar=both&lt;BR /&gt;
 group=hub space=0 gspace=5 maxis=axis1;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
To get something more like the graph in your link, you'd have to pre-calculate everything, and then put together a special data set to do a grouped bar, with a "floating" bar segment for the yellow part (by 'floating', I mean the lower of the 2 segments would be the same color as the background, making it 'invisible', such as ... &lt;A href="http://robslink.com/SAS/democd6/col8.htm" target="_blank"&gt;http://robslink.com/SAS/democd6/col8.htm&lt;/A&gt; ).  And then annotate the box plot onto each of the bars (you'd need to pre-calculate the y-value for each of the pieces of the boxplot to use to construct your box plot: mean, lower, upper, etc).  It would be a bit "cumbersome" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Maybe/hopefully one of the new ODS Graphics procs provides an easier solution(?)  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 16 Apr 2010 12:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75493#M2803</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-04-16T12:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75494#M2804</link>
      <description>If you are running SAS 9.2, try something like the code below to see if this is what you want:&lt;BR /&gt;
&lt;BR /&gt;
proc sgpanel data=your_data;&lt;BR /&gt;
panelby test_time_bin / layout=columnlattice noborder onepanel;&lt;BR /&gt;
vbox your_subval_variable / category=Substrate;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
There are other ways to tweak this example, but let me know if this the general form of what you want.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Fri, 16 Apr 2010 14:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75494#M2804</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-04-16T14:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75495#M2805</link>
      <description>Thanks Fellas!&lt;BR /&gt;
&lt;BR /&gt;
I don't like the idea of having to jump through too many hoops to get at what I want so I'm going to explore the SGPANEL solution, which is very close to what I want.&lt;BR /&gt;
&lt;BR /&gt;
After I plugged in my data set, I would like 2 additional changes (if possible).  #1 is kind of a show stopper and number 2 is just a nicety. &lt;BR /&gt;
&lt;BR /&gt;
1.  I need the panelby variable (test_time_bin) to display only the values on the graph.  It is currently combining the variable name + the value.  For example I need it to be "a. 0-100 hrs" instead of "Test_Time_Bin = a. 0-100 hrs", etc.....  The data actually gets cut off unless I create a huuuuuuuuuuge graph, which I don't want to do.&lt;BR /&gt;
&lt;BR /&gt;
2.  I would like to get this entire group of panelby groups to the bottom of the graph instead of the top.&lt;BR /&gt;
&lt;BR /&gt;
Boy I sure wish this forum would accept pictures so I could clearly explain what I'm looking for.  Let me know if you need more info.&lt;BR /&gt;
&lt;BR /&gt;
here's the code so far.&lt;BR /&gt;
&lt;BR /&gt;
ods graphics / reset width=1200px height=700px MAXLEGENDAREA=50 IMAGEMAP=On;&lt;BR /&gt;
ods html file='test.html' path="C:\" style=Festival;&lt;BR /&gt;
title "Test Boxplots";&lt;BR /&gt;
&lt;BR /&gt;
proc sgpanel data=WORK.BER_Deltas_with_Attributes ;&lt;BR /&gt;
panelby test_time_bin / layout=columnlattice noborder onepanel;&lt;BR /&gt;
vbox Num_Soft_Errs_delta / category=SBR_c;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods html close;</description>
      <pubDate>Fri, 16 Apr 2010 14:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75495#M2805</guid>
      <dc:creator>GDA</dc:creator>
      <dc:date>2010-04-16T14:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75496#M2806</link>
      <description>1. Use the NOVARNAME option on the PANELBY statement.&lt;BR /&gt;
&lt;BR /&gt;
2. Use the COLHEADERPOS=BOTTOM option on the PANELBY statement.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Fri, 16 Apr 2010 15:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-grouping/m-p/75496#M2806</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2010-04-16T15:06:14Z</dc:date>
    </item>
  </channel>
</rss>

