<?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 number of events by three different variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612449#M178715</link>
    <description>&lt;P&gt;Yes, thank you for the reminder &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2019 16:31:26 GMT</pubDate>
    <dc:creator>psnorrod</dc:creator>
    <dc:date>2019-12-17T16:31:26Z</dc:date>
    <item>
      <title>counting number of events by three different variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612206#M178578</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;New-ish SAS user here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to count the number of events that occur by year, sex, and age_group. I have attached two data sets where "sample1" represents my data and "sample2" represents what I need for a final product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the code below, SAS will count the number of events but is combining age groups. For example, during 2003 combines the events for age_group=3 into the count of events for age_group=3 for state=27.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* count code */&lt;/P&gt;&lt;P&gt;proc sort data = one;&lt;BR /&gt;by year state;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data two;&lt;BR /&gt;set one;&lt;BR /&gt;by year state ;&lt;BR /&gt;if first.state then count = 0;&lt;BR /&gt;count + 1;&lt;BR /&gt;if last.state;&lt;BR /&gt;keep year count Sex age_group;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Sample1" represents my data and "Sample2" represents the what I want in a final product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 20:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612206#M178578</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-12-16T20:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of events by three different variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612407#M178693</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202926"&gt;@psnorrod&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please put your sample data directly in the question as many of us won't download files due to security issues.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 14:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612407#M178693</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-17T14:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: counting number of events by three different variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612449#M178715</link>
      <description>&lt;P&gt;Yes, thank you for the reminder &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 16:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/counting-number-of-events-by-three-different-variables/m-p/612449#M178715</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-12-17T16:31:26Z</dc:date>
    </item>
  </channel>
</rss>

