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: ntimeofday-- format and calculation problems with date and time


From   Alison McCarthy <[email protected]>
To   stata <[email protected]>
Subject   st: ntimeofday-- format and calculation problems with date and time
Date   Sun, 20 Feb 2011 14:54:18 +1100

Dear statalist
I have imported dates and time from excel and wish to convert these into a format suitable for analysis. My variables read as follows:

ID	arrivaltime		       Outcome3	19/02/2011 22:20       injury	
My end-goal is to do a survival analysis, but to do this,  I believe I need to convert variables into the stata date/time formats.
The program that seems to handle the above best if Nick Cox's  "ntimeofday"
The variable I generate using this formulation is:
ntimeofday arrivaltime, gen(ARRIVED) s (dmy h min) n(day) cend(2050).
I have then tried to format the new variable into:
dd-mm-yyyy  hh-mm
However, I cannot seem to make this work. If anyone could tell me what I am doing wrong I would be most grateful.Best wishesAllison 		 	   		  
*
*   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