<?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 finding mean for each deal_id in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718616#M34756</link>
    <description>&lt;P&gt;Hi. I'm very new to SAS.&lt;/P&gt;&lt;P&gt;I have an excel file that I need help with. So I need to add a new column called rate for each deal_id. This rate is equal to the average rate (second column) 125 days prior to the announcement date. The date of the rate is the first column and the announcement date is the third column.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quannguyen_0-1613054234164.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54599i0FE0EAF8D66774D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quannguyen_0-1613054234164.png" alt="Quannguyen_0-1613054234164.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2021 14:40:51 GMT</pubDate>
    <dc:creator>Quannguyen</dc:creator>
    <dc:date>2021-02-11T14:40:51Z</dc:date>
    <item>
      <title>finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718616#M34756</link>
      <description>&lt;P&gt;Hi. I'm very new to SAS.&lt;/P&gt;&lt;P&gt;I have an excel file that I need help with. So I need to add a new column called rate for each deal_id. This rate is equal to the average rate (second column) 125 days prior to the announcement date. The date of the rate is the first column and the announcement date is the third column.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quannguyen_0-1613054234164.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54599i0FE0EAF8D66774D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quannguyen_0-1613054234164.png" alt="Quannguyen_0-1613054234164.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 14:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718616#M34756</guid>
      <dc:creator>Quannguyen</dc:creator>
      <dc:date>2021-02-11T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718622#M34758</link>
      <description>&lt;P&gt;First of all, provide usable data.&lt;/P&gt;
&lt;P&gt;This means&amp;nbsp;&lt;STRONG&gt;SAS&lt;/STRONG&gt; data, unless you have a problem getting external data into SAS. If you have trouble importing Excel data into SAS, attaching the Excel file is a good idea, but in that case we mostly suggest to save spreadsheets to csv files and read those with a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you already have SAS data, post that by using a data step with datalines, so we can easily recreate your dataset for developing and testing with a simple copy/paste and submit. This will also remove any doubts about variable types, sizes, formats and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description, it seems that you want to create a mean of a value, grouped by an identification, where a date column is used for selection against a cutoff value.&lt;/P&gt;
&lt;P&gt;Is that cutoff value (announcement_date) unique for the identification value (deal_id)?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 15:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718622#M34758</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-11T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718638#M34760</link>
      <description>&lt;P&gt;I attached the excel file. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 15:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718638#M34760</guid>
      <dc:creator>Quannguyen</dc:creator>
      <dc:date>2021-02-11T15:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718647#M34761</link>
      <description>&lt;P&gt;Apart from a lot of missing values (which constitute the majority of rows in the spreadsheets), the deal_id values are unique, so it makes no sense calculating a mean in any way for them (as there's always only one value).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please rephrase your question in clear and unambiguous manner, as I have no idea what you want to do.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 16:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718647#M34761</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-11T16:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718673#M34763</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/368870"&gt;@Quannguyen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi. I'm very new to SAS.&lt;/P&gt;
&lt;P&gt;I have an excel file that I need help with. So I need to add a new column called rate for each deal_id. This rate is equal to the average rate (second column) 125 days prior to the announcement date. The date of the rate is the first column and the announcement date is the third column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A generic reminder about "rates": Typically a rate is created by dividing one value by another such as CountX/TotalCount.&lt;/P&gt;
&lt;P&gt;If the rate is calculated in such a manner and the denominator is not the same then taking a mean directly without the actual counts is very problematic.&lt;/P&gt;
&lt;P&gt;Consider: If I drive a car for 1 mile and get 100 miles per gallon (rate of fuel consumption) and drive another 1000 miles and get 10 miles per gallon the "average" miles per gallon is NOT (100+10)/2 = 55 miles per gallon.&lt;/P&gt;
&lt;P&gt;I would need to have total actual fuel consumed / total distance to get accurate average miles per gallon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, what type of "rate" is involved here?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 17:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718673#M34763</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-11T17:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: finding mean for each deal_id</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718676#M34764</link>
      <description>&lt;P&gt;The rate is the data that is collected from the internet, I don't have any specific calculation for it&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 17:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/finding-mean-for-each-deal-id/m-p/718676#M34764</guid>
      <dc:creator>Quannguyen</dc:creator>
      <dc:date>2021-02-11T17:28:32Z</dc:date>
    </item>
  </channel>
</rss>

