<?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 help with summary stats and grouping in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304436#M10723</link>
    <description>&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Esteemed-Advisor"&gt;&lt;SPAN class="login-bold"&gt;ballardw - thank you for your response. Yes, my second code uses the proc boxplot method, the viewmax=100 is used in the first code attempt (using proc template/sgrender). I have not found anything similar to restrict the y-axis using proc boxplot.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2016 17:58:37 GMT</pubDate>
    <dc:creator>NAI124</dc:creator>
    <dc:date>2016-10-13T17:58:37Z</dc:date>
    <item>
      <title>boxplot help with summary stats and grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304146#M10720</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need to make a box plot showing groups of species (by family). An excerpt of data is below. I would like to add summary statistics for the entire dataset and also for each species. I would also like to limit my y-axis to 100. I've tried two codes that give me parts of what I am looking for but niether seems to do the trick.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thanks&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;ods listing close;&lt;BR /&gt;ods html style=minimal gpath="I:\xxx\PRG" ;&lt;BR /&gt;&lt;BR /&gt;ods graphics on /&lt;BR /&gt;imagename="Boxplot"&lt;BR /&gt;imagefmt=png&lt;BR /&gt;border=off;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*this code was creating using ods graphics design and uses a legend/color to group species by family, which is less preferred than the second code, but y-axis to 100 works, also no summary statistics in this version;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;define statgraph sgdesign;&lt;BR /&gt;dynamic _VERTICAL _SPECIES_NAME _FAMILY;&lt;BR /&gt;begingraph / designwidth=800 designheight=689;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layout overlay / xaxisopts=( display=(TICKS TICKVALUES LINE ) discreteopts=( tickvaluefitpolicy=splitrotate)) yaxisopts=( label=('Inches') linearopts=( viewmin=0.0 viewmax=100.0)) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boxplot x=_SPECIES_NAME y=_VERTICAL / group=_FAMILY name='box' groupdisplay=Overlay grouporder=ascending;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; discretelegend 'box' / opaque=false border=true halign=center valign=top displayclipped=true down=1 order=columnmajor location=inside ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endlayout;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgrender data=WORK.DI template=sgdesign ;&lt;BR /&gt;dynamic _VERTICAL="VERTICAL" _SPECIES_NAME="'SPECIES_NAME'n" _FAMILY="FAMILY";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*this code groups species in families but apears at the top of the output as opposed to near the species names they are grouping, statistics are also generated, but stats by species are at the bottom and I'd prefer if they were at the top under the overal statistics, also axis is not limited to 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC boxplot data=di;&lt;BR /&gt;label vertical="Inches ";&lt;BR /&gt;plot vertical*species_name (family) /&amp;nbsp; haxis=axis1; *nohlabel;&lt;BR /&gt;inset min mean max stddev / header='Overall Statistics' position=tm;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; insetgroup min max mean/header='Statistics by Species' cframe=black cheader=black position=top;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Species_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vertical&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; family&lt;/P&gt;&lt;P&gt;calico&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aster&lt;/P&gt;&lt;P&gt;flat-topped&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aster&lt;/P&gt;&lt;P&gt;rough-stemmed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goldenrod&lt;/P&gt;&lt;P&gt;NY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aster&lt;/P&gt;&lt;P&gt;NE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aster&lt;/P&gt;&lt;P&gt;grass-leaved&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goldenrod&lt;/P&gt;&lt;P&gt;jack-in-th-pulpit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orchid&lt;/P&gt;&lt;P&gt;lady's tresses&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orchid&lt;/P&gt;&lt;P&gt;purple fringed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orchid&lt;/P&gt;&lt;P&gt;yellow lady's slipper&amp;nbsp; 9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orchid&lt;/P&gt;&lt;P&gt;black-eyed susan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daisy&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 16:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304146#M10720</guid>
      <dc:creator>NAI124</dc:creator>
      <dc:date>2016-10-12T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: boxplot help with summary stats and grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304176#M10721</link>
      <description>&lt;P&gt;Did you consider Proc Boxplot with Inset and Insetgroup options?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your use of VIEWMAX=100 on the yaxisopts is what is restricting the axis value to 100.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 19:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304176#M10721</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-12T19:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: boxplot help with summary stats and grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304178#M10722</link>
      <description>&lt;P&gt;I took your code and made a few changes:&lt;/P&gt;
&lt;P&gt;1. I removed the LAYOUT LATTICE, as you do not need it for your case.&lt;/P&gt;
&lt;P&gt;2. I move the sizing outside of the template.&lt;/P&gt;
&lt;P&gt;3. I changed GROUPDISPLAY to be CLUSTER instead of OVERLAY. This will give you adjacent group boxes.&lt;/P&gt;
&lt;P&gt;4. I added DISPLAYSTATS=STANDARD to the BOXPLOT statement. This will display your stats below the boxes. You can limit the stats displayed by using a parenthesized list of stats (e.g. DISPLAYSTATS=(Mean Median ... ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give this a try and see if it gives you what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;BR /&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph sgdesign;
dynamic _VERTICAL _SPECIES_NAME _FAMILY;
begingraph;
    layout overlay / xaxisopts=( display=(TICKS TICKVALUES LINE ) discreteopts=( tickvaluefitpolicy=splitrotate)) yaxisopts=( label=('Inches') linearopts=( viewmin=0.0 viewmax=100.0)) ;
       boxplot x=_SPECIES_NAME y=_VERTICAL / group=_FAMILY name='box' groupdisplay=cluster grouporder=ascending displaystats=standard;
       discretelegend 'box' / opaque=false border=true halign=center valign=top displayclipped=true down=1 order=columnmajor location=inside;      &lt;BR /&gt;endlayout;
endgraph;
end;
run;

ods graphics / width=800px;
proc sgrender data=WORK.DI template=sgdesign ;
dynamic _VERTICAL="VERTICAL" _SPECIES_NAME="'SPECIES_NAME'n" _FAMILY="FAMILY";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 19:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304178#M10722</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2016-10-12T19:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: boxplot help with summary stats and grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304436#M10723</link>
      <description>&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Esteemed-Advisor"&gt;&lt;SPAN class="login-bold"&gt;ballardw - thank you for your response. Yes, my second code uses the proc boxplot method, the viewmax=100 is used in the first code attempt (using proc template/sgrender). I have not found anything similar to restrict the y-axis using proc boxplot.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 17:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304436#M10723</guid>
      <dc:creator>NAI124</dc:creator>
      <dc:date>2016-10-13T17:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: boxplot help with summary stats and grouping</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304445#M10724</link>
      <description>&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;Thank you for your response. I ran your code but did not see any different results- my log has the following message :&lt;/P&gt;&lt;P&gt;'NOTE: Grouped box plot does not support the DISPLAYSTATS= option. The statistics will not be drawn.'&lt;/P&gt;&lt;P&gt;Thanks again for taking a look!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/boxplot-help-with-summary-stats-and-grouping/m-p/304445#M10724</guid>
      <dc:creator>NAI124</dc:creator>
      <dc:date>2016-10-13T18:49:45Z</dc:date>
    </item>
  </channel>
</rss>

