<?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 antibiotics by a defined period eg. by month. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830639#M41318</link>
    <description>&lt;P&gt;How are you defining "month"? If you have Pregnancy_start_date and Dispensing_date as actual SAS date values then you can calculate the month number using those. One variable with the number of months in a long data set that looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mother_id antibiotics_ID Dispensing_date&amp;nbsp;Pregnancy_start_date Month, one record for each prescription/dispensing_date where "month" is the month number: 1,2,...,9 (10? depending on your "month" assignment rules)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will allow you to make a report that looks like using code similar to&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=need;
   class mother_id pregnancy_start_date month;
   table mother_Id*pregnancy_start_date,
         month*n
   ;
run;&lt;/PRE&gt;
&lt;P&gt;The result would one row for each mother by pregnancy_start, columns for each month number and the count of records for that month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, you probably do not want to consider Child_id because of multiple birth pregnancies. Involve those and a single prescription could be counted for each child. If you data has multiple child_id for a single prescription then you need to filter the data a bit.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 16:55:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-08-26T16:55:49Z</dc:date>
    <item>
      <title>Counting antibiotics by a defined period eg. by month.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830468#M41301</link>
      <description>&lt;P&gt;Hello fellow SAS users,&lt;/P&gt;
&lt;P&gt;I have a data set with the columns: Child_ID which is linked to their mother_ID. Sometimes a mother_ID can occur twice because it’s for the second child. The mother (mother_ID) is linked to their antibiotics prescription called antibiotics_ID and &amp;nbsp;dispensing_date and pregnancy_start_date.&lt;/P&gt;
&lt;P&gt;Now I have created nine monthly dates till birth e.g. Month1, month2 month3…month9. Month1 is from pregnancy_start_date to the end of Month1.&lt;/P&gt;
&lt;P&gt;Assume a mother may be prescribed 0, 1, or multiple antibiotics per month.&lt;/P&gt;
&lt;P&gt;I need to create a count of Num_of_antibiotics each month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Child_ID&amp;nbsp; Mother_ID Pregnancy_start_date&amp;nbsp; Antibiotics_ID &amp;nbsp;dispensing_date&amp;nbsp; Month1 Month2 Month3 … Count_month1 count_month2&amp;nbsp; count_month3&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 03:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830468#M41301</guid>
      <dc:creator>Sharan</dc:creator>
      <dc:date>2022-08-26T03:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Counting antibiotics by a defined period eg. by month.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830530#M41312</link>
      <description>&lt;P&gt;Show us a portion of the data you have. This MUST be shown as SAS data step code, which you can type in yourself, or which you can create by these &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will be much better off doing this in a long format rather than a wide format. Each month is an observation rather than each month is a column.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 10:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830530#M41312</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-26T10:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Counting antibiotics by a defined period eg. by month.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830639#M41318</link>
      <description>&lt;P&gt;How are you defining "month"? If you have Pregnancy_start_date and Dispensing_date as actual SAS date values then you can calculate the month number using those. One variable with the number of months in a long data set that looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mother_id antibiotics_ID Dispensing_date&amp;nbsp;Pregnancy_start_date Month, one record for each prescription/dispensing_date where "month" is the month number: 1,2,...,9 (10? depending on your "month" assignment rules)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will allow you to make a report that looks like using code similar to&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=need;
   class mother_id pregnancy_start_date month;
   table mother_Id*pregnancy_start_date,
         month*n
   ;
run;&lt;/PRE&gt;
&lt;P&gt;The result would one row for each mother by pregnancy_start, columns for each month number and the count of records for that month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, you probably do not want to consider Child_id because of multiple birth pregnancies. Involve those and a single prescription could be counted for each child. If you data has multiple child_id for a single prescription then you need to filter the data a bit.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 16:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Counting-antibiotics-by-a-defined-period-eg-by-month/m-p/830639#M41318</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-26T16:55:49Z</dc:date>
    </item>
  </channel>
</rss>

