Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: decimal years


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: decimal years
Date   Thu, 10 Aug 2006 23:57:20 +0100

I can't see unequivocally how the fractional part 
conveys month and day but this sounds like an issue 
discussed in 

FAQ     .  Handling date information when numbers are in a continuous sequence
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D. Reichel
        2/03    How do I convert date variables into Stata elapsed
                dates when the numbers run together, like 4151999?
                http://www.stata.com/support/faqs/data/dateseq.html

You may find the -todate- command from SSC mentioned in the FAQ 
of use, but I guess you will need to use -subinstr()- to zap the 
decimal point first. 

Nick 
n.j.cox@durham.ac.uk 

Caleb Southworth
 
> How can decimal years be read into stata? The data are %9.4f 
> and identify
> year, month and day, for example
> 
> event1
> 1932.2880
> 1949.0410
> 1939.4270
> 
> I would like to be able to extract the mdy and to be able to tsset my
> data, the latter requiring integers.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index