Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Calculate Age in years and months between 2 dates


From   "Kanter, Rebecca" <rkanter@jhsph.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Calculate Age in years and months between 2 dates
Date   Thu, 5 Jan 2012 12:52:27 -0500

Hi,

I am trying to calculate age in years and months betweeen an interview date (date1) and a birthdate (date2).

For example, if the interview date was 13 Sept 2011 and a birthdate is 06 Jan 2000 such that

and Age = (date1 - date2) / 365.25 = 11.68515

then this person is 11 years and 8 months (12*.68515 = 8.22)

or another example interview date was  18 Oct 2011 and birthdate is 06 Nov 2001 (Age = 9.946612)

so this person is 10 years and 11 months (12*.946612 = 11.36)

So I need to create a new month variable ...is there a way at least to truncate Age at the decimal point and multiply it by 12 ... ?

I hope this makes sense.

Thanks so much for your help.
-Rebecca Kanter
___________________________________________
Rebecca M. Kanter, PhD
Johns Hopkins Bloomberg School of Public Health
Department of International Health
Center for Human Nutrition
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index