<?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 to count each frequency of a singular event multiple times in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796804#M255714</link>
    <description>To get started, insert the missing statement.  Following the SET statement, repeat the BY statement exactly as it appears in the PROC SORT step.</description>
    <pubDate>Thu, 17 Feb 2022 06:05:54 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2022-02-17T06:05:54Z</dc:date>
    <item>
      <title>How to count each value of a variable as separately that is tied to a singular event</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796800#M255712</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In my dataset each person (eventID) is associated with 1-3 pathogens (pathogenSeq). I want to look at the total counts of each of the pathogens, but some people have tested with more than 1 pathogen. How would I make it so that if a person has multiple pathogens they are counted for each pathogen?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I tried per my teacher's advice but the output is blank:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sort data=infection;
by eventID pathogenSeq; run;

data infection2;
set infection;
if first.pathogenSeq = 1 then count = 0;
count = count + 1;
if last.pathogenSeq = 1 then output;
retain count; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Would it make more sense to create a new variable for pathogen? Any help is appreciated, thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 19:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796800#M255712</guid>
      <dc:creator>jasmineburbank</dc:creator>
      <dc:date>2022-02-17T19:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to count each frequency of a singular event multiple times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796804#M255714</link>
      <description>To get started, insert the missing statement.  Following the SET statement, repeat the BY statement exactly as it appears in the PROC SORT step.</description>
      <pubDate>Thu, 17 Feb 2022 06:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796804#M255714</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-02-17T06:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to count each frequency of a singular event multiple times</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796805#M255715</link>
      <description>&lt;P&gt;Maybe:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
  class pathogenSeq;
  output out=counted(drop= _type_ rename=(_freq_ = count));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this doesn't work, please post example data in usable form together with the expected result.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 06:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/796805#M255715</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-02-17T06:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to count each value of a variable as separately that is tied to a singular event</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/797037#M255813</link>
      <description>&lt;P&gt;I added a BY statement and did not receive any error messages.&lt;/P&gt;&lt;P&gt;How would you recommend I verify the procedure worked properly?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 19:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-count-each-value-of-a-variable-as-separately-that-is-tied/m-p/797037#M255813</guid>
      <dc:creator>jasmineburbank</dc:creator>
      <dc:date>2022-02-17T19:52:21Z</dc:date>
    </item>
  </channel>
</rss>

