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

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

From   Svend Juul <SJ@SOCI.AU.DK>
To   <>
Subject   Re: st: How to calculate the time elapsed between two transactions
Date   Thu, 24 Jul 2008 23:31:20 +0200

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 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 

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index