<?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 xaxistable stat=freq in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544908#M150704</link>
    <description>&lt;P&gt;I can't see your data, so needless to say the code below is unstested. However, I think the three options highlighted will give you what you want. I added a Group= option to your VBAR Statement and two options to your xaxistable statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=PD nocycleattrs noborder noautolegend;
   refline -100 to 200 by 50 / axis = y transparency=0.9;
   vbar period / response=PDvalue stat=mean dataskin=pressed fillattrs=(color=green)
                        baselineattrs=(thickness=0) limitstat=stderr barwidth=0.4
                        group=period;                                      /* New Option */

   xaxis display=(noticks nolabel);
   yaxis display=(noticks) ranges=(-100 - 300) label='Mean % PD Value Change' ;
   xaxistable period    / stat=freq label='N=' location=inside
                          nomissingclass classdisplay=cluster; /* New options */
   xaxistable PDvalue / stat=mean label='MEAN=' location=inside;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2019 15:47:50 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-03-21T15:47:50Z</dc:date>
    <item>
      <title>SGPLOT xaxistable stat=freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544901#M150702</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I love to use SGPLOT and find something new useful option every time I use SGPLOT. Recently, I noticed that I can use STAT= option at XAXISTABLE statement. This is great option. However, when I use STAT=FREQ option, the frequency is all observation instead of only non-missing observation. Is there any way to remove missing cases? So, if the there isn't any non-missing values in a group, I love to put zero instead of blank and also show only non-missing N. Here is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=PD nocycleattrs noborder noautolegend;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;refline -100 to 200 by 50 / axis = y transparency=0.9;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;vbar period / response=PDvalue stat=mean dataskin=pressed fillattrs=(color=green)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; baselineattrs=(thickness=0) limitstat=stderr barwidth=0.4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;xaxis display=(noticks nolabel);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis display=(noticks) ranges=(-100 - 300) label='Mean % PD Value Change' ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;xaxistable period&amp;nbsp; &amp;nbsp; / stat=&lt;FONT color="#FF0000"&gt;freq&lt;/FONT&gt; label='N=' location=inside;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;xaxistable PDvalue / stat=mean label='MEAN=' location=inside;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MEAN values of PDvalue are ok since ignoring missing values when we create MEAN. However, the freq values are not non-missing N. I can just drop all missing values before I run this procedure, but I like to indicate PERIOD value even if all PD values are missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544901#M150702</guid>
      <dc:creator>BAGaucho</dc:creator>
      <dc:date>2019-03-21T15:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT xaxistable stat=freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544908#M150704</link>
      <description>&lt;P&gt;I can't see your data, so needless to say the code below is unstested. However, I think the three options highlighted will give you what you want. I added a Group= option to your VBAR Statement and two options to your xaxistable statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=PD nocycleattrs noborder noautolegend;
   refline -100 to 200 by 50 / axis = y transparency=0.9;
   vbar period / response=PDvalue stat=mean dataskin=pressed fillattrs=(color=green)
                        baselineattrs=(thickness=0) limitstat=stderr barwidth=0.4
                        group=period;                                      /* New Option */

   xaxis display=(noticks nolabel);
   yaxis display=(noticks) ranges=(-100 - 300) label='Mean % PD Value Change' ;
   xaxistable period    / stat=freq label='N=' location=inside
                          nomissingclass classdisplay=cluster; /* New options */
   xaxistable PDvalue / stat=mean label='MEAN=' location=inside;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544908#M150704</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-21T15:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT xaxistable stat=freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544911#M150705</link>
      <description>&lt;P&gt;Be aware though that the NOMISSINGCLASS Option is supported only is SAS 9.4M3 and later.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544911#M150705</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-21T15:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT xaxistable stat=freq</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544972#M150727</link>
      <description>&lt;P&gt;Thanks for your quick reply, draycut!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I posted, I thought about what I did and found my own mistake. I asked for frequency of each period so obviously SAS will provide all observation count per period no matter what the y-axis values are missing or not. Stupid of me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I specified PDvalue instead of period, but format issue exists since I specified a format for PDvalue. Well, I decided to use very old trick which creating a new count variable as CNT (=1 if non missing) and use CNT to calculate frequency.&amp;nbsp; Yes, works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know, I should thought about twice before I posted this. I will be extra careful next time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SGPLOT-xaxistable-stat-freq/m-p/544972#M150727</guid>
      <dc:creator>BAGaucho</dc:creator>
      <dc:date>2019-03-21T18:05:46Z</dc:date>
    </item>
  </channel>
</rss>

