<?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: how to calculate average of duplicates across multiple rows and columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-average-of-duplicates-across-multiple-rows-and/m-p/562755#M157681</link>
    <description>&lt;P&gt;A relatively straightforward way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
   set have;
   array trial {3};
   do k=1 to 3;
      if trial{k} &amp;gt; . then do;
         value = trial{k};
         output;
      end;
   end;
run;

proc summary data=temp nway;
   var value;
   class id;
   output out=want (drop=_type_ _freq_) n = NTrials mean = Mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 May 2019 02:32:59 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-05-31T02:32:59Z</dc:date>
    <item>
      <title>how to calculate average of duplicates across multiple rows and columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-average-of-duplicates-across-multiple-rows-and/m-p/562742#M157676</link>
      <description>&lt;P&gt;Hi everyone.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks like the one below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ID&amp;nbsp; &amp;nbsp; &amp;nbsp;Trial1&amp;nbsp; &amp;nbsp; &amp;nbsp;Trial2&amp;nbsp; &amp;nbsp; &amp;nbsp;Trial3&lt;/P&gt;&lt;P&gt;Feb 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;74&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;71&lt;/P&gt;&lt;P&gt;Feb 10&amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;71&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;72&lt;/P&gt;&lt;P&gt;Mar 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;76&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mar 12&amp;nbsp; &amp;nbsp; &amp;nbsp; C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;78&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mar 23&amp;nbsp; &amp;nbsp; &amp;nbsp; C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;79&lt;/P&gt;&lt;P&gt;Mar 30&amp;nbsp; &amp;nbsp; &amp;nbsp; C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to produce an output like the one below showing the total number of trials per ID and average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp;NTrials&amp;nbsp; &amp;nbsp; &amp;nbsp; Mean&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;72&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;76&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;79.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yoyong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 23:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-average-of-duplicates-across-multiple-rows-and/m-p/562742#M157676</guid>
      <dc:creator>yoyong555</dc:creator>
      <dc:date>2019-05-30T23:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate average of duplicates across multiple rows and columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-average-of-duplicates-across-multiple-rows-and/m-p/562755#M157681</link>
      <description>&lt;P&gt;A relatively straightforward way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
   set have;
   array trial {3};
   do k=1 to 3;
      if trial{k} &amp;gt; . then do;
         value = trial{k};
         output;
      end;
   end;
run;

proc summary data=temp nway;
   var value;
   class id;
   output out=want (drop=_type_ _freq_) n = NTrials mean = Mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 02:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-average-of-duplicates-across-multiple-rows-and/m-p/562755#M157681</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-31T02:32:59Z</dc:date>
    </item>
  </channel>
</rss>

