<?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 do I figure out an average margin of points between two datasets? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175270#M44985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;BR /&gt;input team $ points_earned points_give;&lt;BR /&gt;cards;&lt;BR /&gt;Lions 20 10&lt;BR /&gt;Ravens 30 21&lt;BR /&gt;Broncos 30 5&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select * from have&lt;BR /&gt;having points_earned-points_give=max(points_earned-points_give);&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Nov 2014 13:57:32 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2014-11-21T13:57:32Z</dc:date>
    <item>
      <title>How do I figure out an average margin of points between two datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175269#M44984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have two datasets and I have the points earned and the points given up for a list of sports teams. I want to find out the highest margin between points earned-points given up. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if it was like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Team&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Points Earned&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Points Given up&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Lions&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Ravens&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Broncos&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then we would know the Broncos had the highest margin. How do I write a formula for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 04:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175269#M44984</guid>
      <dc:creator>zoeshrugged</dc:creator>
      <dc:date>2014-11-18T04:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I figure out an average margin of points between two datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175270#M44985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;BR /&gt;input team $ points_earned points_give;&lt;BR /&gt;cards;&lt;BR /&gt;Lions 20 10&lt;BR /&gt;Ravens 30 21&lt;BR /&gt;Broncos 30 5&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select * from have&lt;BR /&gt;having points_earned-points_give=max(points_earned-points_give);&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 13:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175270#M44985</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-11-21T13:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I figure out an average margin of points between two datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175271#M44986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input&amp;nbsp; Team $ Points_Earned Points_Given_up ;&lt;BR /&gt;datalines;&lt;BR /&gt;Lions 20 10 &lt;BR /&gt;Ravens 30 21 &lt;BR /&gt;Broncos 30 5 &lt;BR /&gt;Tigers 80 75&lt;BR /&gt;Baggers 80 55&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data want (drop=i dif record) ;&lt;/P&gt;&lt;P&gt;length record $ 30;&lt;/P&gt;&lt;P&gt;do until(last);&lt;BR /&gt;set have end=last;&lt;BR /&gt;i+1;&lt;/P&gt;&lt;P&gt;if dif &amp;lt;Points_Earned-Points_Given_up then &lt;BR /&gt; do; &lt;BR /&gt;&amp;nbsp; dif=Points_Earned-Points_Given_up;&lt;BR /&gt;&amp;nbsp; record=i;&lt;BR /&gt; end;&lt;BR /&gt;else if dif=Points_Earned-Points_Given_up then &lt;BR /&gt; record=cats(i,"|",record);&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i=1;&lt;BR /&gt;if find(record,"|") then&lt;BR /&gt; do while (not(missing(scan(record,i,"| "))));&lt;BR /&gt;&amp;nbsp; acces=input(scan(record,i,"|"),8.);&lt;BR /&gt;&amp;nbsp; set have point=acces;&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp; i=i+1;&lt;BR /&gt; end;&lt;BR /&gt;else &lt;BR /&gt; do;&lt;BR /&gt;&amp;nbsp; acces=input(compress(record),8.);&lt;BR /&gt;&amp;nbsp; set have point=acces;&lt;BR /&gt; output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 15:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-figure-out-an-average-margin-of-points-between-two/m-p/175271#M44986</guid>
      <dc:creator>Loko</dc:creator>
      <dc:date>2014-11-21T15:01:43Z</dc:date>
    </item>
  </channel>
</rss>

