Statalist


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

st: data management - converting string HH:MM to actual numeric integer values


From   "b. water" <[email protected]>
To   <[email protected]>
Subject   st: data management - converting string HH:MM to actual numeric integer values
Date   Thu, 29 Jan 2009 19:26:54 +0000

Dear all,
 
Stata 8.2,
 
I really must apologize for asking this query. I am on the road for a few days and do not have access to my Stata manuals. Much to my annoyance I discovered that I have not dealt with one of the variable (called duration) in the form of hh:mm e.g. 01:55 i.e. duration of an event that lasted an hour and fifty five minutes. I am sure this would have been described somewhere in the manuals.
 
As it stands, the variable is thus described: str8 %9s.
 
I tried to look at the stata on-line help on date and time and something i thought would be good i.e. str2time to see how I can convert this to time duration that I can subsequently analyze (e.g. to be able summarize or create categories) but without success. 
 
I would therefore be grateful for any advice/help on how to convert this string variable to a form or format that stata can recognise as time hh:mm or better still to just convert them to integers e.g. 01:55 would then become 115 (minutes) - an integer. Of course any other suggestions would be valued.
 
Thank you,
bw
_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index