[EpiData-list] Age

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Sun Dec 2 20:48:48 CST 2007


In Analysis, if your variables are:

DOB - date of birth
SOMDAT - date at which you wish to know age in years

define age ###
age = year(somdat) - year(dob) - 
iif(dmy(day(dob),month(dob),year(somdat)) > somdat,1,0)

This just finds the difference in years and then subtracts one if the 
birthday in the comparison falls after the date SOMDAT.
The Help for EpiData Entry gives an approximate way of doing this as 
well. The above method will never be wrong.

Jamie

Gaspar wrote:
> I need some help to figure out an age at a given date.
> For instance: what is the age of someone born in 15/june/1970 on this
> date: 31/dec/2006?
>
>   


More information about the EpiData-list mailing list