Statalist


[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   <statalist@hsphsun2.harvard.edu>
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

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



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