<?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: include a figure illustrating box plot elements in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581234#M18693</link>
    <description>&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm producing a PDF with box plots and need&amp;nbsp;an introductory page showing the&amp;nbsp;figure illustrating box plot elements that's provide in the SAS documentation, near the&amp;nbsp;bottom of&amp;nbsp;the page,&amp;nbsp;at:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=grstatgraph&amp;amp;docsetTarget=p0vuh82v39fsasn1vqhzmhdl8y16.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;https://documentation.sas.com/?docsetId=grstatgraph&amp;amp;docsetTarget=p0vuh82v39fsasn1vqhzmhdl8y16.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone share their code for doing this, or give me a hint on accomplishing this in SAS 9.4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Bill.&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2019 18:10:53 GMT</pubDate>
    <dc:creator>BillSukloff</dc:creator>
    <dc:date>2019-08-14T18:10:53Z</dc:date>
    <item>
      <title>BoxPlot: include a figure illustrating box plot elements</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581234#M18693</link>
      <description>&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm producing a PDF with box plots and need&amp;nbsp;an introductory page showing the&amp;nbsp;figure illustrating box plot elements that's provide in the SAS documentation, near the&amp;nbsp;bottom of&amp;nbsp;the page,&amp;nbsp;at:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=grstatgraph&amp;amp;docsetTarget=p0vuh82v39fsasn1vqhzmhdl8y16.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;https://documentation.sas.com/?docsetId=grstatgraph&amp;amp;docsetTarget=p0vuh82v39fsasn1vqhzmhdl8y16.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone share their code for doing this, or give me a hint on accomplishing this in SAS 9.4?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Bill.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 18:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581234#M18693</guid>
      <dc:creator>BillSukloff</dc:creator>
      <dc:date>2019-08-14T18:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: BoxPlot: include a figure illustrating box plot elements</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581360#M18694</link>
      <description>&lt;P&gt;There are several ways to do this. Are you looking for &lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=15.1&amp;amp;docsetTarget=statug_boxplot_details09.htm&amp;amp;locale=en" target="_self"&gt;the basic box-and-whisker plot &lt;/A&gt;&lt;/P&gt;
&lt;P&gt;or do you need something more complicated like a notched box plot? Do you also want to show the IQR and fences?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd use PROC MEANS of the OUTBOX= option in PROC BOXPLOT to get the numerical values for each feature. The graph will be a little tricky, but I'd try to use the HBOX statement to draw the box plot for real data and use the TEXT statement to add the explanatory text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 09:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581360#M18694</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-08-15T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: BoxPlot: include a figure illustrating box plot elements</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581370#M18695</link>
      <description>&lt;P&gt;I made a reference card like you're describing, several years back.&amp;nbsp; (With apologies to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;, for my use of the ancient rannor to simulate some data, at the time my eyes had not been opened to the beauty of the RAND function!).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data samp;
  retain 
    mean   70
    stddev 10
  ;

  do id=1 to 100; 
    Score=mean+stddev*rannor(3);
    if id=10 then score=25; 
    output;
  end;
run;

*hard code the values of statistics;
%let outlier=25;
%let min=44.49;
%let Q1=60.61;
%let mean=68.07;
%let median=70.49;
%let Q3=75.28;
%let max=89.17;

%macro DrawArrow(y=
                ,label=
                 );
        drawarrow x1=80 x2=70 y1=&amp;amp;y y2=&amp;amp;y /
          x1space=wallpercent
          x2space=wallpercent
          y1space=datavalue
          y2space=datavalue
        ;   
        drawtext "&amp;amp;label" /
          width=25
          x=82 y=&amp;amp;y
          xspace=wallpercent 
          yspace=datavalue
          anchor=left
        ;

%mend DrawArrow;

proc template;
  define statgraph MyBoxPlot;
    begingraph /
      border=false
    ;
      layout overlay /
        walldisplay=none
      ;      
        boxplot x=Class y=Score/
          spread=true
        ;
        %drawArrow(label=Outlier,y=&amp;amp;outlier)
        %drawArrow(label=Minimum (excluding outliers),y=&amp;amp;Min)
        %drawArrow(label=25th Percentile,y=&amp;amp;Q1)
        %drawArrow(label=Mean,y=&amp;amp;mean)
        %drawArrow(label=Median,y=&amp;amp;median)
        %drawArrow(label=75th Percentile,y=&amp;amp;Q3)
        %drawArrow(label=Maximum (excluding outliers),y=&amp;amp;Max)
      endlayout;
    endgraph;
  end;
run;


ods escapechar='^';
options nonumber;
ods listing close;
ods pdf file="%sysfunc(pathname(work))\BoxPlotReferenceCard.pdf" style=journal notoc;
title1 "Box Plot Reference Card";
footnote1 j=l "Source: SAS Graph Template Language Reference p. 215";
proc sgrender data=samp template="MyBoxPlot";
run;


ods pdf text="^{newline 5}";
ods pdf text="^{style [fontweight=bold]Outlier Definition (Gory Statistical Details)}";
ods pdf text="A value is an outlier if it is outside of the interval: [  P25 - 1.5*IQR  ,  P75 + 1.5*IQR  ] ";
ods pdf text="Where:";
ods pdf text="^{nbspace 4}P25 = 25th Percentile";
ods pdf text="^{nbspace 4}P75 = 75th Percentile";
ods pdf text="^{nbspace 4}IQR = Interquartile Range (75th Percentile - 25th Percentile)";
title1;
ods pdf close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Aug 2019 11:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/581370#M18695</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2019-08-15T11:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: BoxPlot: include a figure illustrating box plot elements</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/584394#M18787</link>
      <description>&lt;P&gt;Thanks for the suggestions. I&amp;nbsp;selected the image&amp;nbsp;of box plot elements,&amp;nbsp;saved it on my pc, and inserted the image&amp;nbsp;on a separate page in my PDF file containing box plots, using the following approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_ALL_&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CLOSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;OPTIONS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;NODATE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;NONUMBER&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;PDF&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;FILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\temp\testimage.pdf'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;STYLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Dove &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;PDFTOC&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; PROCLABEL &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"BoxPlotDescription"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;NOPROCTITLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;GSLIDE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;IFRAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'c:\temp\Box_Key_SG.png'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;IMAGESTYLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = FIT&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DESCRIPTION&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Box Plot - Description'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;TITLE1&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;'Box Plot: Description'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;J&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=r &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;H&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;"&amp;amp;sysdate9"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;PDF&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;CLOSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 01:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/584394#M18787</guid>
      <dc:creator>Bill_in_Toronto</dc:creator>
      <dc:date>2019-08-28T01:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: BoxPlot: include a figure illustrating box plot elements</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/584480#M18788</link>
      <description>&lt;P&gt;I thought this was an interesting question, so I decided to ask myself a similar question: Given a set of data, can you draw the box plot and augment the box plot with a description of the important statistics and outliers &lt;STRONG&gt;for that data?&lt;/STRONG&gt;&amp;nbsp;In other words, can you solve the OP's problem in a data-driven way?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My thoughts on the matter and some SAS code for how to create this image for any data set are available in the article&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/08/28/schematic-box-plot.html" target="_self"&gt;"Annotate features of a schematic box plot in SGPLOT."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 09:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BoxPlot-include-a-figure-illustrating-box-plot-elements/m-p/584480#M18788</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-08-28T09:30:18Z</dc:date>
    </item>
  </channel>
</rss>

