<?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: Average claims per year before and after an index date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480788#M124273</link>
    <description>Yes, as well as enroll start and end&lt;BR /&gt;</description>
    <pubDate>Tue, 24 Jul 2018 13:02:42 GMT</pubDate>
    <dc:creator>cdubs</dc:creator>
    <dc:date>2018-07-24T13:02:42Z</dc:date>
    <item>
      <title>Average claims per year before and after an index date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480712#M124244</link>
      <description>&lt;P&gt;Have this dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;patient_id / claim_date / index_date / enroll_start / enroll_end&lt;/P&gt;&lt;P&gt;1 01JAN2010&amp;nbsp;&lt;SPAN&gt;01JAN2013 01JAN2010 15DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 05FEB2012&amp;nbsp;&lt;SPAN&gt;01JAN2013&amp;nbsp;01JAN2010 15DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 01JAN2013 01JAN2013&amp;nbsp;&lt;SPAN&gt;01JAN2010 15DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 05AUG2015&amp;nbsp;&lt;SPAN&gt;01JAN2013&amp;nbsp;01JAN2010 15DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 01JAN2010 &lt;SPAN&gt;03MAR2016&amp;nbsp;01JAN2010 31DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 05FEB2012 &lt;SPAN&gt;03MAR2016&amp;nbsp;01JAN2010 31DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 01JAN2013 &lt;SPAN&gt;03MAR2016&amp;nbsp;01JAN2010 31DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 05AUG2015 &lt;SPAN&gt;03MAR2016&amp;nbsp;01JAN2010 31DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;03MAR2016&amp;nbsp;03MAR2016&amp;nbsp;01JAN2010 31DEC2016&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Want the following output (outputs mean hospitalizations per year for time period before vs. ON or after index date)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;patient_id avg_hosp_preindex avg_hosp_postindex&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 0.66 0.51&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 0.65 1.197&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;^ there may be manual calculation errors but basically&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg_hosp_preindex&amp;nbsp;=&amp;nbsp;# of hospitalizations per year (time period from&amp;nbsp;enroll_start to index_date)&amp;nbsp;&lt;/P&gt;&lt;P&gt;avg_hosp_postindex = # of hospitalizations per year (time period from index_date to enroll_end).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was thinking of the following&amp;nbsp;steps&lt;/P&gt;&lt;P&gt;1. Create variable "pre index time" as enroll_start to index_date, in years&lt;/P&gt;&lt;P&gt;2. Create variable "post index time" as index_date to enroll_end, in years&lt;/P&gt;&lt;P&gt;3. Create variable "pre index hosp count" as sum of&amp;nbsp;claims if claim date &amp;lt; index date&lt;/P&gt;&lt;P&gt;4. Create variable "post index hosp count" as sum of claims if claim date &amp;gt;= index date&lt;/P&gt;&lt;P&gt;5. Create variable "pre index avg hosp" as "pre index hosp count" / "pre index time"&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. Create variable "post index avg hosp" as "post index hosp count" / "post index time"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a simpler way to do this? What is the best way to sum the number of claims (e.g. "pre index hosp count") by the same patient id?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 05:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480712#M124244</guid>
      <dc:creator>cdubs</dc:creator>
      <dc:date>2018-07-24T05:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Average claims per year before and after an index date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480713#M124245</link>
      <description>&lt;P&gt;Is&amp;nbsp;&lt;SPAN&gt;index_date&amp;nbsp;always the same across IDs?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 05:37:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480713#M124245</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-24T05:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Average claims per year before and after an index date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480788#M124273</link>
      <description>Yes, as well as enroll start and end&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Jul 2018 13:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Average-claims-per-year-before-and-after-an-index-date/m-p/480788#M124273</guid>
      <dc:creator>cdubs</dc:creator>
      <dc:date>2018-07-24T13:02:42Z</dc:date>
    </item>
  </channel>
</rss>

