<?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: Boxplot comparing different samples- only connecting some groups in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602286#M19075</link>
    <description>&lt;P&gt;As a minimum the code used to create that graph would be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there are very few plots that can mix with the VBOX you may want to turn of the connection in VBOX and create an annotate data set to connect the 3 desired mean values for the categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option might be to have a different analysis variable for the "other" data and have two vbox statements. Make sure that the two analysis variables are only assigned for the appropriate category values.&lt;/P&gt;
&lt;P&gt;An example with made up data to demonstrate principal:&lt;/P&gt;
&lt;PRE&gt;data example;
   do group= 1 to 3;
      do i= 1 to 20;
      y1 = rand('uniform');
      output;
      end;
   end;
   /* clear for example data the y1*/
   y1=.;
   group=4;
   do i=1 to 20;
      y2= rand('uniform');
      output;
   end;
run;

proc sgplot data=example;
   vbox y1 / connect=mean category=group ;
   vbox y2 / category=group;
run;&lt;/PRE&gt;
&lt;P&gt;Note that because the categories have missing values for the analysis variables you will get notes in the log about incomplete or invalid data and "some boxes will not be drawn".&lt;/P&gt;
&lt;P&gt;You will likely want to suppress the legend, or modify it. By default the two sets of boxes are likely to also be in different colors.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2019 00:42:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-11-07T00:42:42Z</dc:date>
    <item>
      <title>Boxplot comparing different samples- only connecting some groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602274#M19074</link>
      <description>&lt;P&gt;The first three boxes are groups from the same sample while the last box is from a different sample entirely. Is it possible to keep this graph the same but have the line not connect to the last box? I used proc sgplot to generate the graph connecting on mean. Any help is much appreciated! Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="boxplot.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33733i6D4BD478422C8FB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="boxplot.png" alt="boxplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 23:35:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602274#M19074</guid>
      <dc:creator>lbogar314</dc:creator>
      <dc:date>2019-11-06T23:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot comparing different samples- only connecting some groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602286#M19075</link>
      <description>&lt;P&gt;As a minimum the code used to create that graph would be helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since there are very few plots that can mix with the VBOX you may want to turn of the connection in VBOX and create an annotate data set to connect the 3 desired mean values for the categories.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option might be to have a different analysis variable for the "other" data and have two vbox statements. Make sure that the two analysis variables are only assigned for the appropriate category values.&lt;/P&gt;
&lt;P&gt;An example with made up data to demonstrate principal:&lt;/P&gt;
&lt;PRE&gt;data example;
   do group= 1 to 3;
      do i= 1 to 20;
      y1 = rand('uniform');
      output;
      end;
   end;
   /* clear for example data the y1*/
   y1=.;
   group=4;
   do i=1 to 20;
      y2= rand('uniform');
      output;
   end;
run;

proc sgplot data=example;
   vbox y1 / connect=mean category=group ;
   vbox y2 / category=group;
run;&lt;/PRE&gt;
&lt;P&gt;Note that because the categories have missing values for the analysis variables you will get notes in the log about incomplete or invalid data and "some boxes will not be drawn".&lt;/P&gt;
&lt;P&gt;You will likely want to suppress the legend, or modify it. By default the two sets of boxes are likely to also be in different colors.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 00:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602286#M19075</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-07T00:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Boxplot comparing different samples- only connecting some groups</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602311#M19076</link>
      <description>&lt;P&gt;I think the best option to display what you describe is to use a boxplot grouped by sample. Here is a little program to simulate the idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33736iA1529173D8243D52/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
do x=1 to 4;
   if x &amp;lt; 4 then samp=40;
   else samp=100;
   do t=1 to 10;
      response=ranuni(123);
      output;
   end;
end;
run;

proc sgplot data=sample;
vbox response / category=x group=samp groupdisplay=overlay connect=mean;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you don't want the color change, the other option is to do as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;suggested, and that was pre-compute the mean and overlay an annotated line or a SERIES plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 04:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Boxplot-comparing-different-samples-only-connecting-some-groups/m-p/602311#M19076</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-11-07T04:18:58Z</dc:date>
    </item>
  </channel>
</rss>

