[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Transforming a decimal number into hours and minutes

From   Peer Skov <>
To   <>
Subject   st: Transforming a decimal number into hours and minutes
Date   Fri, 7 Aug 2009 10:54:17 +0000

Hi listers,
I am working with a survey dataset. The individuals have all been asked to report how much time they have spent on a specific activity. The answers are recorded in the dataset as a numeric variable the provided answers are integers (hours worked). 
I want to assign conditional means to the individuals who have not answered the hour question. Calculating the means leads to a decimal number and therefore I need to transform the decimal-part into minutes. Since Statas date function only work with strings and a decimal number cannot be turned in to a string I am not sure how I can solve it.
bysort edu: egen hoursA=mean(hours)
replace hours=hoursA if hours ==. & active == 1
I need to turn 3.89 into 3.53
All thoughts are much appreciated.
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
*   For searches and help try:

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