![]() ** fix special case where only for reference year 2015, kids born onĭec 31 are getting odd ages of 19.000 for age15 and 18 for age15b. To compute age using a date of birth and the current. The same issue didn't happen to any other Dec 31st children for any of the other years in my data.Īge15 = INT(yrdif(MemberDateOfBirth,'31Dec2015'd,'actual')) In SAS, date type variables contain the number of days between January 1, 1960, and the date specified. This only occurred for the children born 31Dec1996 using 31Dec2015 as a reference date. The reference to the variable "age15b" below was because when I tested the YRDIF method for age15 below without the INT function, the age resolved to 19.000. The precision of the MemberDateOfBirth (a stored SAS date variable) was causing the age15 variable to resolve to 18 with no decimal places for children born 31Dec1996 using 31Dec2015 as the reference year. With some recent data, I was using the YRDIF method and ran into some special cases where I was calculating ages on some claims data for children across three different years. Working with dates is always tricky and you should always check your results. Especially when trying to find newborns where age is less than 1. I stopped using it when I discovered that the calculation would sometimes produce odd results.
0 Comments
Leave a Reply. |