<?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: Need help on SAS code for calculating person years to use as denominators to calculate crude rat in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275200#M55005</link>
    <description>&lt;P&gt;What happens if there is no death during the period, how is the date represented? I'm assuming month_death/year_death are numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if  month_death ne . then end=mdy(month_death, 1, year_death);
else end=mdy(12, 1, 2014);

n_months=intck('month', "01Jan2013"d, end);
on_street = n_months - sum(of doc1-doc48);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 04 Jun 2016 22:38:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-04T22:38:22Z</dc:date>
    <item>
      <title>Need help on SAS code for calculating person years to use as denominators to calculate crude rates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275194#M55003</link>
      <description>&lt;P&gt;I have a dataset of 25000 records with this layout;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DOC1 DOC2 &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;D&lt;/SPAN&gt;&lt;SPAN&gt;OC4 &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;DOC48&amp;nbsp; Month_death year_death &amp;nbsp; &amp;nbsp; race &amp;nbsp; &amp;nbsp; &amp;nbsp;age &amp;nbsp; &amp;nbsp; &amp;nbsp; gender&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2014 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOC1-DOC48&amp;nbsp;have 0&amp;nbsp;if the person was on the streets, 1&amp;nbsp;if incarcerated&lt;/P&gt;
&lt;P&gt;DOC1 corresponds to January 2011&lt;/P&gt;
&lt;P&gt;DOC48 corresponds to December 2014&lt;/P&gt;
&lt;P&gt;Death records are from Jan 2013 to Dec 2014. We only have month and year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so for this person id #1, she was incarcerated on February 2011 and has been&amp;nbsp;out on the streets since April 2011. I need to count her "street" time as the actual time at risk for dying- DOC1, DOC4-DOC48 -46 months. Need to do this for all records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will need to calculate time to death for those that died and time to end of study (Dec 2014) for everyone else for a survival analysis And finally fill-in this table for those that died.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="389"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="125"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;Number of deaths&lt;/TD&gt;
&lt;TD width="87"&gt;Persons-Years at Risk&lt;/TD&gt;
&lt;TD width="90"&gt;CMR per 100 person years&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1 month&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3 months&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6 months&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1 year&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2 year&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;All deaths&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="87"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;many thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 20:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275194#M55003</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2016-06-04T20:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on SAS code for calculating person years to use as denominators to calculate crude rat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275200#M55005</link>
      <description>&lt;P&gt;What happens if there is no death during the period, how is the date represented? I'm assuming month_death/year_death are numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if  month_death ne . then end=mdy(month_death, 1, year_death);
else end=mdy(12, 1, 2014);

n_months=intck('month', "01Jan2013"d, end);
on_street = n_months - sum(of doc1-doc48);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jun 2016 22:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275200#M55005</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-04T22:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on SAS code for calculating person years to use as denominators to calculate crude rat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275215#M55010</link>
      <description>Thanks Reeza, if there are no deaths,  then the end of the study period is December 2014. And yes these are numeric</description>
      <pubDate>Sun, 05 Jun 2016 04:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-on-SAS-code-for-calculating-person-years-to-use-as/m-p/275215#M55010</guid>
      <dc:creator>malena</dc:creator>
      <dc:date>2016-06-05T04:07:09Z</dc:date>
    </item>
  </channel>
</rss>

