[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: hours and minutes help
I wouldn't use -egenmore- here, as
an attack from first principles is more direct.
gen endtime2 = floor(endtime) + mod(endtime,1) / 60
gen starttime2 = floor(starttime) + mod(starttime,1) / 60
gen lapse = endtime2 - starttime2
> I was wondering if any of you know of a method for creating
> 2 new variables from 1 variable, with 1 of the new
> variables containing whole numbers and the second new
> variable containing the numbers after a decimal point.
> I am asking this because I have time data (hours: minutes)
> in which the hours and minutes are separated by a decimal
> point instead of a colon (so 6:45 AM is expressed as 6.45,
> not 6.75).
> I have 2 variables: starttime and endtime. I need to
> subtract start-times from the end-times, which I cannot due
> with the present variable format. I was thinking of using
> the "hmm" function that is part of the -egenmore- package.
> But I need to separate the hours and minutes and this is
> where I get stuck.
* For searches and help try: