<?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: Calculate Average using Proc Tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487760#M71995</link>
    <description>&lt;P&gt;HI:&lt;BR /&gt; You need to have a VAR statement with an analysis variable in order to get the MEAN statistic. It doesn't make sense to get the mean of either applicationdate or flagname. There must be a numeric variable someplace in your data that is the one you want the MEAN statistic for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.shoes;
where product in ('Boot' 'Sandal' "Men's Dress" "Women's Dress");
class product region ;
var sales;
table region='Region' all='Total', 
      (product='')*(N='') (all='SUM')*(N='#') sales*mean;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Fri, 17 Aug 2018 13:43:14 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2018-08-17T13:43:14Z</dc:date>
    <item>
      <title>Calculate Average using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487737#M71991</link>
      <description>&lt;P&gt;I&amp;nbsp;want to generate a report using PROC TABULATE,&lt;/P&gt;&lt;P&gt;It will contain sum and average of the variables specified in class.&lt;/P&gt;&lt;P&gt;I am able to calculalte sum, but couldnt generate mean/average&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title "Credit Sentry Report";&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;tabulate&lt;/STRONG&gt; data=CreditSentryFlag3 missing;&lt;/P&gt;&lt;P&gt;format applicationdate weekdate17.;&lt;/P&gt;&lt;P&gt;class flagname applicationdate /descending;&lt;/P&gt;&lt;P&gt;table flagname='' all='Total', (applicationdate='')*(N='') (all='SUM')*(N='#') ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to add an extra column average next to sum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--ADITYA&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 12:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487737#M71991</guid>
      <dc:creator>Ady23</dc:creator>
      <dc:date>2018-08-17T12:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487739#M71992</link>
      <description>&lt;P&gt;Since I don't know PROC TABULATE, I can't fix your code. However, the whole thing is very easy to do in PROC SUMMARY or PROC REPORT, and I could provide example code for either of those.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 12:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487739#M71992</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-17T12:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487741#M71993</link>
      <description>If any of those PROC helps me get the sum and mean or average, i`ll wil happy to use it, can you please provide the steps.</description>
      <pubDate>Fri, 17 Aug 2018 12:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487741#M71993</guid>
      <dc:creator>Ady23</dc:creator>
      <dc:date>2018-08-17T12:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487743#M71994</link>
      <description>&lt;P&gt;Okay, well I need a little clarification from you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the name(s) of the continuous variable you want to sum and average? It seems like you have only specified class variables in the code you show above. And you want both&amp;nbsp;&lt;SPAN&gt;flagname and applicationdate to be class?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 12:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487743#M71994</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-17T12:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Average using Proc Tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487760#M71995</link>
      <description>&lt;P&gt;HI:&lt;BR /&gt; You need to have a VAR statement with an analysis variable in order to get the MEAN statistic. It doesn't make sense to get the mean of either applicationdate or flagname. There must be a numeric variable someplace in your data that is the one you want the MEAN statistic for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=sashelp.shoes;
where product in ('Boot' 'Sandal' "Men's Dress" "Women's Dress");
class product region ;
var sales;
table region='Region' all='Total', 
      (product='')*(N='') (all='SUM')*(N='#') sales*mean;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 13:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculate-Average-using-Proc-Tabulate/m-p/487760#M71995</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-08-17T13:43:14Z</dc:date>
    </item>
  </channel>
</rss>

