<?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: SGPLOT VBOX How to get statistics int a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578436#M164059</link>
    <description>Probably but it would likely be in a format for plotting and not totally useful. You can easily get that from PROC MEANS or SUMMARY into a nicely formatted data set. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas&lt;/A&gt;</description>
    <pubDate>Thu, 01 Aug 2019 14:44:21 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-08-01T14:44:21Z</dc:date>
    <item>
      <title>SGPLOT VBOX How to get statistics int a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578430#M164055</link>
      <description>&lt;P&gt;Is there a way to get the stats used in vbox into a sas dataset for later usage?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This example was posted a few years ago, but it only shows how to get the statistics into the plot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sgplot data=want;&lt;BR /&gt; label weight_n='N' weight_min='MIN' weight_max='MAX' &lt;BR /&gt; weight_median='MEDIAN' weight_mean='MAEAN';&lt;BR /&gt; vbox weight/category=sex group=sex;&lt;BR /&gt; xaxistable weight_n weight_min weight_max weight_median weight_mean&lt;BR /&gt; / x=sex colorgroup=sex location=inside;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 14:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578430#M164055</guid>
      <dc:creator>rclivornese</dc:creator>
      <dc:date>2019-08-01T14:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX How to get statistics int a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578436#M164059</link>
      <description>Probably but it would likely be in a format for plotting and not totally useful. You can easily get that from PROC MEANS or SUMMARY into a nicely formatted data set. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas&lt;/A&gt;</description>
      <pubDate>Thu, 01 Aug 2019 14:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578436#M164059</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-01T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX How to get statistics int a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578475#M164081</link>
      <description>&lt;P&gt;That won't directly provide all the critical points for the box plot. (e.g. the ends of the whiskers are not the min/max of the whole data set).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this will do it. Please let me know if you think this is accurate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc means data=have nway noprint;&lt;BR /&gt;class sex;&lt;BR /&gt;var weight;&lt;BR /&gt;output out=stat min= max= median= mean= p25= p75=&lt;BR /&gt;n=/autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data stat; set stat;&lt;BR /&gt;upgate=weight_p75+1.5*(weight_p75-weight_p25);&lt;BR /&gt;downgate=weight_p75-1.5*(weight_p75-weight_p25);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table have2 as&lt;BR /&gt;select a.*&lt;BR /&gt;from have a&lt;BR /&gt;INNER JOIN&lt;BR /&gt;stat b&lt;BR /&gt;on a.sex = b.sex&lt;BR /&gt;where a.weight between downgate and upgate&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;proc means data=have2 nway;&lt;BR /&gt;class sex;&lt;BR /&gt;var weight;&lt;BR /&gt;output out=out_wisk&lt;BR /&gt;min=wisk_min&lt;BR /&gt;max=wisk_max&lt;BR /&gt;n=/autoname;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select a.sex,&lt;BR /&gt;b.wisk_min,&lt;BR /&gt;a.weight_p25,&lt;BR /&gt;a.weight_median,&lt;BR /&gt;a.weight_mean,&lt;BR /&gt;a.weight_p75,&lt;BR /&gt;b.wisk_max&lt;BR /&gt;from stat a&lt;BR /&gt;INNER JOIN&lt;BR /&gt;out_wisk b&lt;BR /&gt;on a.sex = b.sex&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578475#M164081</guid>
      <dc:creator>rclivornese</dc:creator>
      <dc:date>2019-08-01T15:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX How to get statistics int a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578483#M164084</link>
      <description>&lt;P&gt;Add this before your SGPLOT statement. You'll likely have to reformat it then.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output sgplot=want;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Found via this blog post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some instructions and explanations on how to capture output that is shown. &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods-output-statement/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods-output-statement/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/178280"&gt;@rclivornese&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is there a way to get the stats used in vbox into a sas dataset for later usage?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This example was posted a few years ago, but it only shows how to get the statistics into the plot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=want;&lt;BR /&gt; label weight_n='N' weight_min='MIN' weight_max='MAX' &lt;BR /&gt; weight_median='MEDIAN' weight_mean='MAEAN';&lt;BR /&gt; vbox weight/category=sex group=sex;&lt;BR /&gt; xaxistable weight_n weight_min weight_max weight_median weight_mean&lt;BR /&gt; / x=sex colorgroup=sex location=inside;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-VBOX-How-to-get-statistics-int-a-dataset/m-p/578483#M164084</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-01T15:49:37Z</dc:date>
    </item>
  </channel>
</rss>

