<?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 Adding statistics to a data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-statistics-to-a-data-set/m-p/344110#M79055</link>
    <description>&lt;P&gt;I have a question and want to ask question by using example. My data-set is:&lt;/P&gt;
&lt;P&gt;Group Value&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;BR /&gt;I want to add two columns to this data-set. First column should consist of maximum value of second column by group. Second column should consist of minimum value of second column by group. So, the result should be look:&lt;BR /&gt;&lt;BR /&gt;Group Value Max Min&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10 &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; &amp;nbsp; &amp;nbsp;12 &amp;nbsp; 8&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13 &amp;nbsp; &amp;nbsp; &amp;nbsp;13 &amp;nbsp; 7&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; 13 &amp;nbsp; 7&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13 &amp;nbsp; 7&lt;BR /&gt;&lt;BR /&gt;12 - because there are 3 numbers (10,8,12) in group number 1 and 12 is maximum among these values.&lt;BR /&gt;13 - because there are 3 numbers (13,11,7) in group number 2 and 13 is maximum among these values.&lt;BR /&gt;8 - because there are 3 numbers (10,8,12) in group number 1 and 8 is minimum among these values.&lt;BR /&gt;7 - because there are 3 numbers (13,11,7) in group number 2 and 7 is minimum among these values.&lt;BR /&gt;I hope, i can explain it..&lt;BR /&gt;Many thanks in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 17:06:53 GMT</pubDate>
    <dc:creator>Khaladdin</dc:creator>
    <dc:date>2017-03-24T17:06:53Z</dc:date>
    <item>
      <title>Adding statistics to a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-statistics-to-a-data-set/m-p/344110#M79055</link>
      <description>&lt;P&gt;I have a question and want to ask question by using example. My data-set is:&lt;/P&gt;
&lt;P&gt;Group Value&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;BR /&gt;I want to add two columns to this data-set. First column should consist of maximum value of second column by group. Second column should consist of minimum value of second column by group. So, the result should be look:&lt;BR /&gt;&lt;BR /&gt;Group Value Max Min&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10 &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8 &amp;nbsp; &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; 8&lt;BR /&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12 &amp;nbsp; &amp;nbsp; &amp;nbsp;12 &amp;nbsp; 8&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13 &amp;nbsp; &amp;nbsp; &amp;nbsp;13 &amp;nbsp; 7&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11 &amp;nbsp; &amp;nbsp; &amp;nbsp; 13 &amp;nbsp; 7&lt;BR /&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13 &amp;nbsp; 7&lt;BR /&gt;&lt;BR /&gt;12 - because there are 3 numbers (10,8,12) in group number 1 and 12 is maximum among these values.&lt;BR /&gt;13 - because there are 3 numbers (13,11,7) in group number 2 and 13 is maximum among these values.&lt;BR /&gt;8 - because there are 3 numbers (10,8,12) in group number 1 and 8 is minimum among these values.&lt;BR /&gt;7 - because there are 3 numbers (13,11,7) in group number 2 and 7 is minimum among these values.&lt;BR /&gt;I hope, i can explain it..&lt;BR /&gt;Many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 17:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-statistics-to-a-data-set/m-p/344110#M79055</guid>
      <dc:creator>Khaladdin</dc:creator>
      <dc:date>2017-03-24T17:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-statistics-to-a-data-set/m-p/344117#M79056</link>
      <description>&lt;P&gt;You can get what you want&amp;nbsp;easily with SQL:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    CREATE TABLE want AS
    SELECT *, 
                  min(value) AS min
                  max(value) AS max
    FROM have
    GROUP BY group;&lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 16:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-statistics-to-a-data-set/m-p/344117#M79056</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-24T16:23:03Z</dc:date>
    </item>
  </channel>
</rss>

