Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Formatting Dates


From   Amp <ampees@vet.ksu.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Formatting Dates
Date   Fri, 10 Jun 2011 05:56:32 -0700 (PDT)

Hello,

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

~AMP


--
View this message in context: http://statalist.1588530.n2.nabble.com/Formatting-Dates-tp6462092p6462092.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index