<?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: Mean Function help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468912#M119828</link>
    <description>&lt;P&gt;in a data step you would have to go back to basics:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data m2;
set sashelp.class end=done;
s + weight;
n + (not missing(weight));
if done then do;
    mean = s/n;
    output;
    end;
keep n mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 09 Jun 2018 06:29:16 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2018-06-09T06:29:16Z</dc:date>
    <item>
      <title>Mean Function help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468906#M119826</link>
      <description>&lt;P&gt;im trying to find out column level mean function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data m;&lt;BR /&gt;input name$ var1 var2 var3;&lt;BR /&gt;cards;&lt;BR /&gt;a 10 0 5&lt;BR /&gt;b 1 2 0&lt;BR /&gt;c 9 5 8&lt;BR /&gt;;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=m nway noprint;&lt;BR /&gt;var var1 var2;&lt;BR /&gt;output out=rmean;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table m3 as&lt;BR /&gt;select mean(var2) as mean&lt;BR /&gt;from m;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now proc means and proc sql both are giving column wise mean value&lt;/P&gt;&lt;P&gt;but i was trying to use this but why this is not working in data set approach:---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data m2;&lt;BR /&gt;set m;&lt;BR /&gt;c1=mean(var2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is not working plz help me&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 03:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468906#M119826</guid>
      <dc:creator>adi121</dc:creator>
      <dc:date>2018-06-09T03:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mean Function help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468910#M119827</link>
      <description>&lt;P&gt;The MEAN function in a DATA step does means across columns within each row, not across rows. Your example then of having one variable inside your MEAN function is pointless as it will just return the value of that column. It is only useful for more than one column.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 04:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468910#M119827</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-06-09T04:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mean Function help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468912#M119828</link>
      <description>&lt;P&gt;in a data step you would have to go back to basics:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data m2;
set sashelp.class end=done;
s + weight;
n + (not missing(weight));
if done then do;
    mean = s/n;
    output;
    end;
keep n mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jun 2018 06:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mean-Function-help/m-p/468912#M119828</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-06-09T06:29:16Z</dc:date>
    </item>
  </channel>
</rss>

