<?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 get the numbers of insetgroup in proc boxplot straight above the bars in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510222#M21959</link>
    <description>&lt;P&gt;If you have SAS 9.4M5 or later, you should use sgplot VBOX statement with DISPLAYSTATS=(MEAN).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Nov 2018 04:53:47 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-11-04T04:53:47Z</dc:date>
    <item>
      <title>How to get the numbers of insetgroup in proc boxplot straight above the bars</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510126#M21958</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics off;&lt;BR /&gt;proc sort data=Simon4 out=Simon4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;by Geschlecht;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc boxplot data=Simon4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;plot (IL10A IL10B IL10C IL10D)*Geschlecht/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;HEIGHT=2 boxstyle=SCHEMATICID cboxfill=BIG cboxes=black;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;insetgroup mean /&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;header = 'Mittelwerte jeweils zur Gruppe darunter';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gives me the following image:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="boxplots.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24615iB84FA533F33FCD4E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="boxplots.png" alt="boxplots.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I achieve that the numbers giving the means (e.g. 33.7385) are above the bars and not justified to the right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 09:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510126#M21958</guid>
      <dc:creator>romangelzhaeuse</dc:creator>
      <dc:date>2018-11-03T09:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the numbers of insetgroup in proc boxplot straight above the bars</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510222#M21959</link>
      <description>&lt;P&gt;If you have SAS 9.4M5 or later, you should use sgplot VBOX statement with DISPLAYSTATS=(MEAN).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 04:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510222#M21959</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-11-04T04:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the numbers of insetgroup in proc boxplot straight above the bars</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510356#M21961</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77314"&gt;@romangelzhaeuse&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all else fails, you can use the annotate feature to mask the existing inset values (with white rectangles) and write the same values where you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create test data for demonstration */

data have;
do i=1 to 100;
  e=rannor(1971);
  do s=-1, 1;
    IL10A=33.7385 +20*s*e; Geschlecht='m'; output;
    IL10A=36.83532+20*s*e; Geschlecht='w'; output;
  end;
end;
run;

proc sort data=have;
  by Geschlecht;
run;

/* Compute mean values */

proc summary data=have;
by Geschlecht;
var il10a;
output out=means mean=mean;
run;

proc transpose data=means out=mw_means(drop=_:) prefix=mean_;
id Geschlecht;
var mean;
run;

/* Create Annotate dataset */

%annomac;

data anno;
length function color $8 style text $20;
set mw_means;
/* Mask the original INSETGROUP values with white
   rectangles and write them at the desired position. */
when='A'; xsys='1'; ysys='5';
%bar(30,95.7,49.5,97.3,white,0,s)                 /* Coordinates (30,   */
%label(30,96,put(mean_m,best8.),black,0,0,1,,B)   /* 95.7, 49.5, etc.)  */
%bar(80,95.7,99.5,97.3,white,0,s)                 /* will likely need   */
%label(69.5,96,put(mean_w,best8.),black,0,0,1,,B) /* to be adapted.     */
run;

/* Produce box plot with "centered" inset values */

proc boxplot data=have anno=anno;
    plot IL10A*Geschlecht/
        HEIGHT=2 boxstyle=SCHEMATICID cboxfill=BIG cboxes=black;
    insetgroup mean /
        header = 'Mittelwerte jeweils zur Gruppe darunter';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result (depending on output device, HSIZE and VSIZE graphics options):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="boxplot.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24642i9F8E1D8F6C5FF4CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="boxplot.png" alt="boxplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 10:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-get-the-numbers-of-insetgroup-in-proc-boxplot-straight/m-p/510356#M21961</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-05T10:40:11Z</dc:date>
    </item>
  </channel>
</rss>

