<?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: Counting observations per observation per month. in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Counting-observations-per-observation-per-month/m-p/73503#M3535</link>
    <description>Suggest you look at using a DATA step to create your "count of analyst" (each gender - using IF &lt;CONDITION&gt; THEN &lt;ASSIGN_VARIABLE&gt;; ) based on some input data condition.  Also, derive a PERIOD_START_DATE using the INTNX function and your "date" variable along with a suitable output format such as YYMM7 or otherwise.  Use PROC SORT to order your data making use of DESCENDING &lt;VARNAME&gt;  option in your BY statement.  Lastly use PROC SUMMARY to accumulate your count/quantlty variables to generate your summarized results output.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/VARNAME&gt;&lt;/ASSIGN_VARIABLE&gt;&lt;/CONDITION&gt;</description>
    <pubDate>Sat, 24 Apr 2010 15:26:37 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-04-24T15:26:37Z</dc:date>
    <item>
      <title>Counting observations per observation per month.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Counting-observations-per-observation-per-month/m-p/73502#M3534</link>
      <description>Hey guys, never thought I would have to make use of the "help me" board but guess everyone needs help now and then. My problem is the following:&lt;BR /&gt;
&lt;BR /&gt;
I have data of the following sort:&lt;BR /&gt;
&lt;BR /&gt;
Ticker _ Date Fem Analyst (dummy 1 if true) __ Variables of that month like beta&lt;BR /&gt;
&lt;BR /&gt;
AA _ 01/04/2001 1 __ 0.61&lt;BR /&gt;
&lt;BR /&gt;
AA _ 05/04/2001 1 __ 0.62&lt;BR /&gt;
&lt;BR /&gt;
AA _ 08/04/2001 1 __ 0.63&lt;BR /&gt;
&lt;BR /&gt;
AA _ 01/05/2002 1 __ 0.7&lt;BR /&gt;
&lt;BR /&gt;
AA _ 04/05/2002 1 __ 0.71&lt;BR /&gt;
&lt;BR /&gt;
AA _ 08/07/2002 0 __ 0.8&lt;BR /&gt;
&lt;BR /&gt;
AA _ 07/04/2003 1 __ 0.4&lt;BR /&gt;
&lt;BR /&gt;
and so on.. What I want to receive is the following:&lt;BR /&gt;
&lt;BR /&gt;
Ticker _ Date Number of fem analyst Number of Male Analysts Total __Variables&lt;BR /&gt;
&lt;BR /&gt;
AA _ 04/2001 3 0 3 __ 0.63&lt;BR /&gt;
&lt;BR /&gt;
AA _ 05/2002 2 0 2 __ 0.71&lt;BR /&gt;
&lt;BR /&gt;
AA _ 07/2002 0 1 1 __ 0.8&lt;BR /&gt;
&lt;BR /&gt;
AA _ 04/2003 1 0 1 __ 0.4&lt;BR /&gt;
&lt;BR /&gt;
So a counting algorithm that allows me to count the number of female and male analyst for a certain company per month( using dummy variable gender 0 or 1) and deletes all observations for that month except the most recent one (for instance for 08/04/01 this becomes 04/01 with 0.63 which is the most recent observation for beta for 04/01 for company AA) The example explains it all I guess?&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?</description>
      <pubDate>Mon, 05 Apr 2010 21:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Counting-observations-per-observation-per-month/m-p/73502#M3534</guid>
      <dc:creator>JR_Prodigy</dc:creator>
      <dc:date>2010-04-05T21:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations per observation per month.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Counting-observations-per-observation-per-month/m-p/73503#M3535</link>
      <description>Suggest you look at using a DATA step to create your "count of analyst" (each gender - using IF &lt;CONDITION&gt; THEN &lt;ASSIGN_VARIABLE&gt;; ) based on some input data condition.  Also, derive a PERIOD_START_DATE using the INTNX function and your "date" variable along with a suitable output format such as YYMM7 or otherwise.  Use PROC SORT to order your data making use of DESCENDING &lt;VARNAME&gt;  option in your BY statement.  Lastly use PROC SUMMARY to accumulate your count/quantlty variables to generate your summarized results output.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/VARNAME&gt;&lt;/ASSIGN_VARIABLE&gt;&lt;/CONDITION&gt;</description>
      <pubDate>Sat, 24 Apr 2010 15:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Counting-observations-per-observation-per-month/m-p/73503#M3535</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-24T15:26:37Z</dc:date>
    </item>
  </channel>
</rss>

