- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 10-05-2010 12:13 PM
(2613 views)
Can you tell me why the Intck function and the Yrdif function will produce two different values when the input dates are the same? I am trying to calculate time at age of entry for patients, and if I use the Intck funciton I am getting some differences than when I use the Yrdif function. Thanks!
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
age is an interestingly challenging assumption
(who knows how many ways there are to calculate age? 😉
-- what would you like ?
- remember years have differing numbers of days
- decide when those born on a 29th Feb should celebrate their 18th and 21st birthdays
age nearest?
age next birthday?
number of days old is probably the only reliable calculation
so again, how would you like to calculate age - what are your rules?
peterC
P.S.
yrdif() is deprecated for age calculations, see SAS USAGE NOTE:
36977 - Using the YRDIF function to calculate age can give incorrect results
at http://support.sas.com/kb/36/977.html
(who knows how many ways there are to calculate age? 😉
-- what would you like ?
- remember years have differing numbers of days
- decide when those born on a 29th Feb should celebrate their 18th and 21st birthdays
age nearest?
age next birthday?
number of days old is probably the only reliable calculation
so again, how would you like to calculate age - what are your rules?
peterC
P.S.
yrdif() is deprecated for age calculations, see SAS USAGE NOTE:
36977 - Using the YRDIF function to calculate age can give incorrect results
at http://support.sas.com/kb/36/977.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I found your thread from google and I believe it is the only INTCK vs. YRDIF thread and I am having the same issue while reading the base exam prep guide.
INTCK counts +1 every time it encounters 1 Jan.
YRDIF counts +1 for every 365 (or 360 or 366 days depending on the optional third argument you use, I don't know how the 30/360 work tho)
SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).