<?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: Avg of an array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109313#M258761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need an array&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AVG = mean (of y1 -- y1000) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Aug 2013 13:52:01 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2013-08-13T13:52:01Z</dc:date>
    <item>
      <title>Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109312#M258760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the average of 1000 values as the last column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1&amp;nbsp; y2 ... y1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVG&lt;/P&gt;&lt;P&gt;a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ 1000 simulations result]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Here is the avg of 1000 values&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not even started the simulation, but I imagine I will use&lt;/P&gt;&lt;P&gt;array sim{1000} y;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 13:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109312#M258760</guid>
      <dc:creator>MattLin</dc:creator>
      <dc:date>2013-08-13T13:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109313#M258761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need an array&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AVG = mean (of y1 -- y1000) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 13:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109313#M258761</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-08-13T13:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109314#M258762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Richard !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I use array, then is this correct?&lt;/P&gt;&lt;P&gt;AVG = mean(of sim{1} - sim{1000} );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Side question, what is the difference b/w one dash - and two dashes --&amp;nbsp;&amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 14:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109314#M258762</guid>
      <dc:creator>MattLin</dc:creator>
      <dc:date>2013-08-13T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109315#M258763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if we consider that there are variables like below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y1 y2 y3..............y1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then we can take the average of all these variable in the below way &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;average=mean(of y1-y1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way we will get the average of all the 1000 variables into one variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jagadish&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 14:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109315#M258763</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-13T14:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109316#M258764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another approach of using arrays to get the means of the variables is as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array avg(*) y1-y1000;&lt;/P&gt;&lt;P&gt;average=mean(of avg(*));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;jagadish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 14:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109316#M258764</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-08-13T14:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109317#M258765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding the side question ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A single dash would be preferred here.&amp;nbsp; It refers to the list of variables that have the same prefix, with a numeric suffix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The double dash also refers to a list of variables, but the name pattern does not matter.&amp;nbsp; This is a legitimate list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cat -- dog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It means all the variables in the data set, in the order in which they were created, starting with CAT and ending with DOG.&amp;nbsp; If you are not sure of the internal order of variables, PROC CONTENTS will tell you.&amp;nbsp; It can even print its report using the internal order rather than the alphabetical order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Aug 2013 17:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109317#M258765</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-08-13T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Avg of an array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109318#M258766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The choice of a double dash in my response was deliberate, in case the O/P had simplified (as is often the case) the names of the variables and they were not a numerical sequence.&amp;nbsp; It would give exactly the same results unless for some reason another variable was created mid sequence, which in this instance seemed unlikely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 00:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Avg-of-an-array/m-p/109318#M258766</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2013-08-15T00:58:47Z</dc:date>
    </item>
  </channel>
</rss>

