<?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: calculate age-specific person years in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781713#M249133</link>
    <description>I forgot to mention that it will be used as data for analysis.</description>
    <pubDate>Mon, 22 Nov 2021 13:17:17 GMT</pubDate>
    <dc:creator>asandri</dc:creator>
    <dc:date>2021-11-22T13:17:17Z</dc:date>
    <item>
      <title>calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781694#M249120</link>
      <description>&lt;P&gt;In my dataset, I have&amp;nbsp;date of birth (dob), start date (sdate) and end/stop date (edate) and I would like to calculate age-specific person years. Ideally, a list of variables should be created that looks like this:&lt;/P&gt;&lt;P&gt;patientid agegrp1_24 agegrp20_25&amp;nbsp;agegrp26_35&amp;nbsp;agegrp36_&lt;/P&gt;&lt;P&gt;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1.2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;101&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;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.7&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me? Thank you.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 11:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781694#M249120</guid>
      <dc:creator>asandri</dc:creator>
      <dc:date>2021-11-22T11:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781702#M249123</link>
      <description>&lt;P&gt;You will need to explain further. When you say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;In my dataset, I have&amp;nbsp;date of birth (dob), start date (sdate) and end/stop date (edate)&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This doesn't correspond to the table you have shown in any way. What is the connection? Explain (in words) how the desired calculations would be done. Show us a portion of this data set.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 12:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781702#M249123</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-22T12:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781706#M249126</link>
      <description>&lt;P&gt;Let me explain a bit further with a simple example. Let's consider a participant (partA) who was born in 1980, entered the study in 2000 and stopped participating in it in 2020 (e.g. dob=1.1.1980 sdate=1.1.2000 edate=1.1.2020). This person contributed a total of 20 person years in the study (i.e. edateb - sdate).&lt;/P&gt;&lt;P&gt;For my analysis, let's also say that I am organising the participants (according to their age) into 3 age groups, i.e. agegroup1: &amp;lt;25; agegroup2: [25-34); and agegroup3: &amp;gt;=35.&lt;/P&gt;&lt;P&gt;The 20 years of total person time partA contributed to the study are distributed across these 3 age groups, i.e. 5 years in agegroup1, 10 years in agegroup2 and 5 years in agegroup3 (since during the 20 years of their participation partA 'moved' from agegroup1 to agegroup2 and to agegroup3).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this is clearer now, thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 12:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781706#M249126</guid>
      <dc:creator>asandri</dc:creator>
      <dc:date>2021-11-22T12:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781707#M249127</link>
      <description>&lt;P&gt;Repeating: "&lt;SPAN&gt;Show us a portion of this data set."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, your output table contains these headings:&amp;nbsp;agegrp1_24 agegrp20_25&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The age group 1–24 overlaps the age group 20–25. Is that really what you want? How can patient ID 100 have a 3.4 in age group 1–24 and a 5 in age group 20–25, which seems to me to be impossible and confusing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is the desired output that you show going to be used as a SAS data set for further analysis? Or is it a table for some report?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 13:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781707#M249127</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-22T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781711#M249131</link>
      <description>&lt;P&gt;Please see attached; I would like the 'py' (i.e. the total person time a person is contributing) to be distributed across the four agegrp variables/column.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 13:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781711#M249131</guid>
      <dc:creator>asandri</dc:creator>
      <dc:date>2021-11-22T13:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781713#M249133</link>
      <description>I forgot to mention that it will be used as data for analysis.</description>
      <pubDate>Mon, 22 Nov 2021 13:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781713#M249133</guid>
      <dc:creator>asandri</dc:creator>
      <dc:date>2021-11-22T13:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781715#M249137</link>
      <description>&lt;P&gt;Ok, my mistake, I forgot to ask for data in a form we can use (a .pdf is not a form we can use). We need a portion of your data presented as SAS data step code (&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;). File attachments are not acceptable, as I will not download them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also point out that I asked the following question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Also, your output table contains these headings:&amp;nbsp;agegrp1_24 agegrp20_25&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The age group 1–24 overlaps the age group 20–25. Is that really what you want? How can patient ID 100 have a 3.4 in age group 1–24 and a 5 in age group 20–25, which seems to me to be impossible and confusing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;which you did not answer. Please, from now on, provide all the information requested.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 13:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781715#M249137</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-22T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: calculate age-specific person years</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781720#M249140</link>
      <description>&lt;P&gt;For the data, you can run in SAS:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data py1;&lt;BR /&gt;input dob :ddmmyy10. sdate :ddmmyy10. edate :ddmmyy10. id ageatstart ageatend py ;&lt;BR /&gt;format dob ddmmyy10. sdate ddmmyy10. edate ddmmyy10.;&lt;BR /&gt;datalines;&lt;BR /&gt;05/03/1980 01/01/2005 31/12/2014 1 24 34 10.0 &lt;BR /&gt;12/08/2006 12/08/2006 31/12/2014 2 0 8 8.39 &lt;BR /&gt;19/09/1975 01/01/2005 20/12/2011 3 29 35 6.38&lt;BR /&gt;;&lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The confusion re. age groups was due to me giving examples where different cutoff thresholds were used for organising the age group. Obviously, age groups will be organised as consecutive groups (without any overlap); so let's agree that the desired arrangement for age groups should be: agegrp1: &amp;lt;20; agegrp2: [20-29]; agegrp3: [30,39]; and agegrp4: &amp;gt;=40.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 14:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-age-specific-person-years/m-p/781720#M249140</guid>
      <dc:creator>asandri</dc:creator>
      <dc:date>2021-11-22T14:09:54Z</dc:date>
    </item>
  </channel>
</rss>

