Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Time calculations


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Time calculations
Date   Wed, 20 Nov 2002 20:04:10 -0000

Jawad A. Al-Lawati
 
> I have two variable T1 (fasting time the night before 
> glucose test is done
> expressed as airport time e.g 22.00) and variable  T2 (time 
> when patients
> blood was tested for diabetes expressed as airport time but 
> was collected in
> the morning so does not matter if airport time is expressed 
> but it is in the
> format of 9.00).
> 
> Question: How do I calculate the time difference if between 
> the previous
> evening (when patients fasted and the next mooring when 
> patients were
> tested)
> 

gen diff = T2 + (24 - T1) 


Nick 
n.j.cox@durham.ac.uk 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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