<?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: Is there anything like VBARPARM for Box Plots? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935684#M24776</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example Figure.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98384iED5694963BC5658D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example Figure.jpg" alt="Example Figure.jpg" /&gt;&lt;/span&gt;I would like to plot something like the attached figure but with the ability to specifiy the parameter that determin box size, mean, and whisker min/max based on an output dataset (see attache example).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Jul 2024 02:03:39 GMT</pubDate>
    <dc:creator>grsanford</dc:creator>
    <dc:date>2024-07-13T02:03:39Z</dc:date>
    <item>
      <title>Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935658#M24773</link>
      <description>&lt;P&gt;I would like to creat a "box-plot like" graph with summary statistical ouptut. I would like to be able to specify the box and whisker source data and wonder if there is ANY way in sgplot to do this?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 21:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935658#M24773</guid>
      <dc:creator>grsanford</dc:creator>
      <dc:date>2024-07-12T21:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935659#M24774</link>
      <description>&lt;P&gt;I don't see it in SGPLOT.&amp;nbsp; &amp;nbsp;But it's available in GTL, so you could write the template then use SGRENDER to make the plot.&amp;nbsp;&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p1db7ll5bzyo4nn1pv31g04etput.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p1db7ll5bzyo4nn1pv31g04etput.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 21:50:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935659#M24774</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-07-12T21:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935660#M24775</link>
      <description>&lt;P&gt;You might provide some example data in the form of working data step code that want to display and a description of what to do with each value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a POLYGON statement to create a box and and the HighLow to create whiskers. But you are going to have to provide a lot of explicit values in variables.&lt;/P&gt;
&lt;P&gt;Multiple plot statements in the same call to Proc Sgplot (or sgpanel) will overlay plots within limits&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 21:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935660#M24775</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-07-12T21:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935684#M24776</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example Figure.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98384iED5694963BC5658D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example Figure.jpg" alt="Example Figure.jpg" /&gt;&lt;/span&gt;I would like to plot something like the attached figure but with the ability to specifiy the parameter that determin box size, mean, and whisker min/max based on an output dataset (see attache example).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 02:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935684#M24776</guid>
      <dc:creator>grsanford</dc:creator>
      <dc:date>2024-07-13T02:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935691#M24777</link>
      <description>You want this ?&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/How-to-position-statistics-for-box-and-whiskers-chart-using/m-p/925421" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/How-to-position-statistics-for-box-and-whiskers-chart-using/m-p/925421&lt;/A&gt;</description>
      <pubDate>Sat, 13 Jul 2024 06:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935691#M24777</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-13T06:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935698#M24778</link>
      <description>&lt;P&gt;Yes, use PROC BOXPLOT. There is a standard format for a data set that specifies the values for the box, whiskers, and outliers.&amp;nbsp; Study this example to see the format of the BOX= data set, which can be used to create a box plot from any summary statistics:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* SGPLOT version */
proc sgplot data=sashelp.cars;
vbox mpg_city / category=Origin;
run;

/* to use PROC BOXPLOT, sort by the categorical variable */
proc sort data=sashelp.cars out=cars(keep=Origin mpg_city);
by Origin;
run;

/* Use PROC BOXPLOT to output the values for the schematic box plot */
proc boxplot data=cars;
   plot MPG_CITY*Origin / boxstyle=schematic outbox=Box;
run;

proc print data=Box;
run;

/* create box plot from input data set */
proc boxplot box=Box;
   plot MPG_CITY*Origin / boxstyle=schematic;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here's the doc for PROC BOXPLOT and the input data set:&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_boxplot_details05.htm" target="_blank"&gt;SAS Help Center: Input Data Sets&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Although I suggest PROC BOXPLOT, you can also use PROC SGPLOT. See this article:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2019/08/28/schematic-box-plot.html" target="_blank"&gt;Annotate features of a schematic box plot in SGPLOT - The DO Loop (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 10:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935698#M24778</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-07-13T10:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935717#M24783</link>
      <description>&lt;P&gt;As I mentioned, the BOXPLOTPARM statement in GTL allows you to generate a boxplot from summary statistics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So given summary statistics for two treatment groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input trt stat : $12. value ;
  cards ;
1 min    0
1 Q1     10
1 median 20
1 Q3     30
1 max    40
2 min    20
2 Q1     30
2 median 40
2 Q3     50
2 max    60
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can plot it with :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;proc template;
  define statgraph boxplotparm1;
    begingraph;
      layout overlay;
        boxplotparm y=value x=trt stat=stat;
      endlayout;
    endgraph;
  end;
run;
 
proc sgrender data=have template=boxplotparm1;
run;&lt;/PRE&gt;
&lt;P&gt;And you get:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1720900374495.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98390i7CABA7F5569FC39F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1720900374495.png" alt="Quentin_0-1720900374495.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can add a legend and coloring by group and all that sort of stuff.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2024 19:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935717#M24783</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-07-13T19:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935724#M24786</link>
      <description>&lt;P&gt;I know Rick Quantin have already posted the solution. Here I just would like to show PROC SGPLOT solution to have some fun.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  input trt stat : $12. value ;
  cards ;
1 min    0
1 Q1     10
1 median 20
1 Q3     30
1 max    40
2 min    20
2 Q1     30
2 median 40
2 Q3     50
2 max    60
;
proc transpose data=have out=want;
by trt;
var value;
id stat;
run;

proc sgplot data=want noautolegend;
highlow x=trt low=Q1 high=Q3/type=bar barwidth=0.4 fillattrs=(color=cxBBC2DC) lineattrs=(color=black);
highlow x=trt low=min high=min/type=bar barwidth=0.2 lineattrs=graphdata1 nofill;
highlow x=trt low=max high=max/type=bar barwidth=0.2 lineattrs=graphdata1 nofill;
highlow x=trt low=median high=median/type=bar barwidth=0.4 lineattrs=graphdata1 nofill;
highlow x=trt low=q3 high=max/ lineattrs=graphdata1;
highlow x=trt low=min high=q1/ lineattrs=graphdata1;

xaxis type=discrete;
yaxis label='value';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1720926749278.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98392iE4FEF2F22ADCCDD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1720926749278.png" alt="Ksharp_0-1720926749278.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 03:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935724#M24786</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-14T03:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there anything like VBARPARM for Box Plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935916#M24803</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;! I ended up studying the box= dataset, formatting my data accordingly, and then using proc sgpanel as I am more familiar with manipulating the visuals in sgpanel. I think that the results turned out fantastic!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgpanel data=fig1 noautolegend sganno=anno;&lt;BR /&gt;panelby dpt / rows=2 columns=1 novarname uniscale=column;&lt;BR /&gt;vbox _value_ / group=sys nomean lineattrs=(color=black) medianattrs=(color=black) whiskerattrs=(color=black) capshape=none;&lt;BR /&gt;refline 0 / lineattrs=(color=crimson);&lt;BR /&gt;rowaxis label=" " offsetmax=.1;&lt;BR /&gt;keylegend / title=" " position=bottom noborder;&lt;BR /&gt;run;&amp;nbsp;&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="new figure.png" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98435i135CB930AFCA4247/image-size/large?v=v2&amp;amp;px=999" role="button" title="new figure.png" alt="new figure.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2024 12:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Is-there-anything-like-VBARPARM-for-Box-Plots/m-p/935916#M24803</guid>
      <dc:creator>grsanford</dc:creator>
      <dc:date>2024-07-16T12:40:32Z</dc:date>
    </item>
  </channel>
</rss>

