<?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 the mean of a number of variables in one simple statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180865#M265145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand it correctly, you are trying to mean across the variables. May be this can generate the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array list{*} _numeric_;&lt;/P&gt;&lt;P&gt;mean=mean(of list{*});&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Aug 2014 22:06:09 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-08-30T22:06:09Z</dc:date>
    <item>
      <title>How to calculate the mean of a number of variables in one simple statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180864#M265144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have 100 numeric variables and I'd like to calculate the average while creating a new variable Mean, is there a simple statement that I can use in the data step instead of typing the variable names one by one and then calculate the average?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2014 21:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180864#M265144</guid>
      <dc:creator>chouchou</dc:creator>
      <dc:date>2014-08-30T21:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the mean of a number of variables in one simple statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180865#M265145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand it correctly, you are trying to mean across the variables. May be this can generate the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array list{*} _numeric_;&lt;/P&gt;&lt;P&gt;mean=mean(of list{*});&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Aug 2014 22:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180865#M265145</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-08-30T22:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the mean of a number of variables in one simple statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180866#M265146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look into SAS Variable Lists&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm"&gt;http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p0wphcpsfgx6o7n1sjtqzizp1n39.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functions such as &lt;STRONG&gt;mean&lt;/STRONG&gt; can accept variable lists as arguments. For example &lt;STRONG&gt;z = mean( of a--f, of x:);&lt;/STRONG&gt; will compute the mean of variables &lt;STRONG&gt;a&lt;/STRONG&gt; throuhg &lt;STRONG&gt;f&lt;/STRONG&gt; in your variable list and of all variables with names starting with &lt;STRONG&gt;x&lt;/STRONG&gt;. The variable list notation can save you a lot of typing and make your code more general.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Aug 2014 00:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-calculate-the-mean-of-a-number-of-variables-in-one-simple/m-p/180866#M265146</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-08-31T00:52:49Z</dc:date>
    </item>
  </channel>
</rss>

