Why does calculation of age at given date not work ?
Question sent to info@epidata.dk:
I wrote commands as following, which I follow the help commands:
dob AFTER ENTRY LET age=round(int(("1997/11/01"-dob)/365.25)) END END
But when I change "1997/11/01" into today, as in the following commands, it works! Why so?
dob AFTER ENTRY LET age=round(int((today-dob)/365.25)) END END
So I just want to ask what is the problem, because I strictly followed your commands in help manual, but age cannot be calculated on a given date.
The formulations above are correct, with one exception. THe help file says also:
EpiData was made in Europe and here dates are written in the notation dd/mm/yyyy, so to make the statements above work LET age=round(int(("1997/11/01"-dob)/365.25)) should be: LET age=round(int(("01/11/1997"-dob)/365.25)) regardless of which format dob has.
It is better to send questions like this to the EpiData list at: epidata-list@lists.umanitoba.ca, since the info @ epidata.dk is very often overly filled with spam mails.
Jens Lauritsen Coodinator and initiator of EpiData
participants (1)
-
epidata-list@lists.umanitoba.ca