<?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 in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/423747#M2170</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/175025"&gt;@rvsidhu035&lt;/a&gt;: The original post you responded to was from 2011. Since 9.3 I think the best way to calculate age is to use the yrdif function (see:&amp;nbsp;&lt;A href="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function" target="_blank"&gt;http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function&lt;/A&gt; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 16:24:28 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-12-27T16:24:28Z</dc:date>
    <item>
      <title>Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26088#M1075</link>
      <description>Hi all,&lt;BR /&gt;
      How can I calculate the age of patients from the date of birth. Thanks in advance</description>
      <pubDate>Thu, 10 Mar 2011 07:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26088#M1075</guid>
      <dc:creator>dash</dc:creator>
      <dc:date>2011-03-10T07:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26089#M1076</link>
      <description>a quick google search of calculate age in sas pointed to this&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/24/567.html" target="_blank"&gt;http://support.sas.com/kb/24/567.html&lt;/A&gt;</description>
      <pubDate>Thu, 10 Mar 2011 13:57:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26089#M1076</guid>
      <dc:creator>darrylovia</dc:creator>
      <dc:date>2011-03-10T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26090#M1077</link>
      <description>Hello dash, darrylovia, and everyone,&lt;BR /&gt;
&lt;BR /&gt;
The example at &lt;A href="http://support.sas.com/kb/24/567.html" target="_blank"&gt;http://support.sas.com/kb/24/567.html&lt;/A&gt; (Sample 24567: Calculate a person's age) involves calculation of number of months in the interval between birthday and current date, and the number of years as #months/12 etc.&lt;BR /&gt;
&lt;BR /&gt;
I used to calculate the age as age=int((current-bday)/365.25). Using the data from the example I got the exact same values for age:&lt;BR /&gt;
&lt;BR /&gt;
data birth;&lt;BR /&gt;
  input name $ bday :mmddyy10. current :mmddyy10.;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Miguel      12/31/1973  12/14/2004&lt;BR /&gt;
Joe         02/28/1976  12/14/2004&lt;BR /&gt;
Rutger      03/29/1976  12/14/2004&lt;BR /&gt;
Broguen     03/01/1976  12/14/2004&lt;BR /&gt;
Susan       12/12/1976  12/14/2004&lt;BR /&gt;
Michael     02/14/1971  12/14/2004&lt;BR /&gt;
LeCe        11/09/1967  12/14/2004&lt;BR /&gt;
Hans        07/02/1955  12/14/2004&lt;BR /&gt;
Lou         07/30/1960  12/14/2004&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
data age; &lt;BR /&gt;
   set birth;&lt;BR /&gt;
   if bday ne . and current ne . &lt;BR /&gt;
   then age=int((current-bday)/365.25);&lt;BR /&gt;
   else age=.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print;&lt;BR /&gt;
format bday current worddate20.;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if the {#months/12}  has any advantages over what seems to me much simpler {#days/365.25} method. Can anybody tell me what are the pitfalls with {#days/365.25}?</description>
      <pubDate>Thu, 10 Mar 2011 15:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26090#M1077</guid>
      <dc:creator>statsplank</dc:creator>
      <dc:date>2011-03-10T15:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26091#M1078</link>
      <description>Hello StatsPlank,&lt;BR /&gt;
&lt;BR /&gt;
I  made some testing and found that these formulas gave different ages on at least two following examples:&lt;BR /&gt;
&lt;BR /&gt;
1. Current=10Mar2011 Bday=01Mar2010&lt;BR /&gt;
age(based on #month)=1&lt;BR /&gt;
age(based on #days) = 0&lt;BR /&gt;
&lt;BR /&gt;
2. Current=10Mar2011 Bday=01Mar2009&lt;BR /&gt;
age(based on #month)=1&lt;BR /&gt;
age(based on #days) = 2&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Thu, 10 Mar 2011 16:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26091#M1078</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-10T16:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26092#M1079</link>
      <description>There are well-documented SAS functions for calculating AGE within the SAS system, as well as dealing with DATE and DATETIME type SAS variables.  Very specifically, refer to the INTCK function in the SAS Language DOC, also with the SAS support site and supplemental technical/conference reference material (using your favorite website and/or Internet SEARCH technique).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 10 Mar 2011 16:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26092#M1079</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-03-10T16:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26093#M1080</link>
      <description>Hi:&lt;BR /&gt;
  This is the paper I send to students. The answer depends on what your goal is. As the author points out...if you want to know what age someone will be in a specific year, you might use a different calculation than if you want to know what exact age someone will be on a specific day.&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi30/060-30.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi30/060-30.pdf&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 10 Mar 2011 19:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26093#M1080</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-03-10T19:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26094#M1081</link>
      <description>Deb's paper (that Cynthia@SAS references) is nice.  However, credit must be given to Billy Kreuter who came up with that formula (G) back in the dark ages of SAS 5.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/24/808.html" target="_blank"&gt;http://support.sas.com/kb/24/808.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
For history buffs, if you dig deep enough into the SAS-L archives, you can find the original discussion and derivation.&lt;BR /&gt;
&lt;BR /&gt;
I prefer the (...)/365.25 for statistical modeling as it carries more information about the age.  However for tabular reports, especially with large data sets, Billy's formula gets it right for all but leap-babies.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier &lt;BR /&gt;
Duke</description>
      <pubDate>Thu, 10 Mar 2011 21:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26094#M1081</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-03-10T21:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26095#M1082</link>
      <description>Wow, I knew that formula had been around, but didn't realize how long. Thanks, Doc for the history!&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 11 Mar 2011 03:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26095#M1082</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-03-11T03:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26096#M1083</link>
      <description>Thank you everyone for contributing to this thread!&lt;BR /&gt;
&lt;BR /&gt;
~Olya</description>
      <pubDate>Fri, 11 Mar 2011 14:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/26096#M1083</guid>
      <dc:creator>statsplank</dc:creator>
      <dc:date>2011-03-11T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/423736#M2169</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data age(keep=age);
t_day="xxxxxxxxx"d;
d_birth="xxxxxxx'd;
age=intck("year",d_birth,t_day);
run;
ex;
data age(keep=age);&lt;BR /&gt;t_day="27dec2017"d;&lt;BR /&gt;d_birth="07jun1989"d;&lt;BR /&gt;age=intck("year",d_birth,t_day);&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Dec 2017 14:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/423736#M2169</guid>
      <dc:creator>rvsidhu035</dc:creator>
      <dc:date>2017-12-27T14:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate age</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/423747#M2170</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/175025"&gt;@rvsidhu035&lt;/a&gt;: The original post you responded to was from 2011. Since 9.3 I think the best way to calculate age is to use the yrdif function (see:&amp;nbsp;&lt;A href="http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function" target="_blank"&gt;http://www.sascommunity.org/wiki/Tips:Calculating_Exact_Age_with_the_YRDIF_Function&lt;/A&gt; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 16:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Calculate-age/m-p/423747#M2170</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-27T16:24:28Z</dc:date>
    </item>
  </channel>
</rss>

