Re: st: How to calculate the time elapsed between two transactions

Bea wrote:
I have data about time of transactions and I would like to calculate
the difference (i.e. how much time elapsed between two transactions).
For example I have a transaction at 09:23:03 and the next at 10:43:53,
so the time interval is 1 hour 20 minutes and 50 seconds.
Is there a procedure to calculate the difference between a transaction
and the next one for the whole sample?
======================================================
If you have Stata 10, read the output from:
. help dates and times
Prior to Stata 10, there were no official commands handling time
(clock) information, but there were some unofficial functions
in the -egenmore- package. First:
. ssc install egenmore
Now you have access to some useful -egen- functions. For your
purposes, the -hms()- and -tod()- functions are useful.
Hope this helps
Svend
________________________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C, Denmark
Phone, work: +45 8942 6090
Phone, home: +45 8693 7796
Fax: +45 8613 1580
E-mail: sj@soci.au.dk
_________________________________________________________
*
* 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/