<?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 Determining mean and average from dataset in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370353#M5519</link>
    <description>&lt;P&gt;Hi guys. How can I determine the mean and average for fields&amp;nbsp;of the Total Cholesterol and Glucose of an individual based on age and gender of an individual from the diabetes dataset? Should I sort it first? Any help and advice will be appreciated. Thanks&lt;/P&gt;&lt;P&gt;Diabetes File:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9831i4E86B212C4571AC5/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="diabetes.png" title="diabetes.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Jun 2017 08:43:31 GMT</pubDate>
    <dc:creator>pailek1996</dc:creator>
    <dc:date>2017-06-25T08:43:31Z</dc:date>
    <item>
      <title>Determining mean and average from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370353#M5519</link>
      <description>&lt;P&gt;Hi guys. How can I determine the mean and average for fields&amp;nbsp;of the Total Cholesterol and Glucose of an individual based on age and gender of an individual from the diabetes dataset? Should I sort it first? Any help and advice will be appreciated. Thanks&lt;/P&gt;&lt;P&gt;Diabetes File:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9831i4E86B212C4571AC5/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="diabetes.png" title="diabetes.png" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 08:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370353#M5519</guid>
      <dc:creator>pailek1996</dc:creator>
      <dc:date>2017-06-25T08:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Determining mean and average from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370372#M5520</link>
      <description>&lt;P&gt;wouldn't you want to categorize the age first, since it is a numeric variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;convert it into a character variable. You could get the means from proc means as below. This is an untested code so please change the variable names as per your dataset. The autoname will create the mean variable names by concatenating the&amp;nbsp; variable name with statistics name example chol_mean glucose_mean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=have nway;
class age gender;
var chol glucose;
output out=means mean=/autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 15:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370372#M5520</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-06-25T15:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Determining mean and average from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370373#M5521</link>
      <description>&lt;P&gt;You could apply a format to the AGE variable to group it, as explained by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/41031"&gt;@Jim_G&lt;/a&gt; in this thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Age-Groups-from-Age-Variable/m-p/370295#M24172" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Age-Groups-from-Age-Variable/m-p/370295#M24172&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use PROC MEANS or PROC SUMMARY on the data. If you use PROC SUMMARY with a CLASS statement, no sorting is necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, the "mean" is the same thing as the "average". &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 15:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370373#M5521</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-06-25T15:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Determining mean and average from dataset</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370385#M5522</link>
      <description>&lt;P&gt;If you're using EG and the tasks you can use the Summary Task.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add age and gender into the GROUP variables and Cholesterol into the analysis variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're looking for code here's some examples:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/add_average_value_to_dataset&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 17:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Determining-mean-and-average-from-dataset/m-p/370385#M5522</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-25T17:16:03Z</dc:date>
    </item>
  </channel>
</rss>

