<?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: Adding Summary Statistics to VBOX SGPANEL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448308#M15411</link>
    <description>&lt;P&gt;Thank you! This works nicely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 19:54:21 GMT</pubDate>
    <dc:creator>cbt2119</dc:creator>
    <dc:date>2018-03-23T19:54:21Z</dc:date>
    <item>
      <title>Adding Summary Statistics to VBOX SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448287#M15409</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only have SAS 9.4 TS1M4 and I'm trying to add the summary statistics to each panel, namely "N" and "Mean". I would like to do what the plot option DISPLAYSTATS does in TS1M5, but I'm having difficulty. I found a &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/" target="_self"&gt;Graphically Speaking&lt;/A&gt; blog post showing how to do this in SGPLOT, but is there a way to do it with SGPANEL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Title1 'Mean HIV TNA PCR Ct Values by Category of Age Started ART'; 
Title2 'Categorized by Cohort';
proc sgpanel data=merged1;
	where hivpcrct ne 0 ;
	panelby cohort / rows=4 onepanel uniscale=column;
	vbox hivpcrct / category = artstartcat ;
	colaxis grid offsetmin=0.10 fitpolicy=rotatethin
	VALUEATTRS=(Family=Times Size=10);
	format cohort cohortf. artstartcat artstartcatf.;
	RUN;title;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I want my plot to print the N and mean for each category of Age Started ART (artstartcat). I can use the "DATALABEL" plot option in VBAR, but not in VBOX.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cara&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 18:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448287#M15409</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2018-03-23T18:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Summary Statistics to VBOX SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448299#M15410</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you say, the feature to add the statistics table to VBOX for SGPANEL was added in SAS 9.40M5.&amp;nbsp; The option uses the values already computed for the box plot.&amp;nbsp; To do the same with a prior SAS 9.4 release, you can use the ColAxisTable.&amp;nbsp; But, you will have to compute the statistics yourself using PROC MEANS and merge it into the data as shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*--Compute statistics by Type and Origin--*/
proc means data=sashelp.cars;
  class type origin;
  var horsepower;
  output out=stat(where=(_type_ &amp;gt; 2))
    mean=Mean N=N;
run;
proc print;run;

/*--Merge statistics with original data set--*/
data cars;
  keep type origin horsepower mean n;
  set sashelp.cars stat;
run;
proc print;run;

/*--Render VBox and statistics using ColAxisTable--*/
proc sgpanel data=cars;
  panelby type;
  vbox horsepower / category=origin;
  colaxistable n mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VBox_Stat_Panel.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19428i9D46765C0C4E16CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="VBox_Stat_Panel.png" alt="VBox_Stat_Panel.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448299#M15410</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-03-23T19:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Summary Statistics to VBOX SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448308#M15411</link>
      <description>&lt;P&gt;Thank you! This works nicely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 19:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Adding-Summary-Statistics-to-VBOX-SGPANEL/m-p/448308#M15411</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2018-03-23T19:54:21Z</dc:date>
    </item>
  </channel>
</rss>

