Bookmark and Share

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

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

st: Formatting Dates

From   Amp <>
Subject   st: Formatting Dates
Date   Fri, 10 Jun 2011 05:56:32 -0700 (PDT)


I am trying to do the following:

I have generated a new variable to estimate the age of a patient beginning
with their date of birth to the time they took a blood sample.  Example:
Generate newage = Drawdate- birthdate             (this gives me the actual
number of days)

I made a new variable to get the actual days into years. Example:
                Generate currentage =newage/365.4     (this gives me years)

However, some patients are less than 1 year of age, so I need the age in
years and months.  How do I do this.

I am a novice user, any help would be great.  Thank you


View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

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