Date range selection for age calculation
Dear Epidata team friends, I have two American date format variables. DOB is date of birth of baby and WDATE is date of weighing the baby for the growth monitoring.
I used to write the following statement to calculate the age in months in EPI6
Define age ### Let age=(WDATE DOB)/30.44
That does not work in EPI ANALYSIS
I tried the statement; Let age= (date(WDATE,mdy) - date(DOB,mdy))/30.44 The error message was; Data type mismatch
Please help.
Shavinder Singh
Hi; The result variable (age) should be float type (###.#) Try it this way, it works.
Gilles Delmas
-----Message d'origine----- De : epidata-list@lists.umanitoba.ca [mailto:epidata-list@lists.umanitoba.ca] Envoyé : mardi 20 février 2007 08:16 À : epidata-list-request@lists.umanitoba.ca Cc : epidata-list@lists.umanitoba.ca Objet : [EpiData-list] Date range selection for age calculation
Dear Epidata team friends, I have two American date format variables. DOB is date of birth of baby and WDATE is date of weighing the baby for the growth monitoring.
I used to write the following statement to calculate the age in months in EPI6
Define age ### Let age=(WDATE - DOB)/30.44
That does not work in EPI ANALYSIS
I tried the statement; Let age= (date("WDATE","mdy") - date("DOB","mdy"))/30.44 The error message was; Data type mismatch
Please help.
Shavinder Singh
participants (1)
-
epidata-list@lists.umanitoba.ca