Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: algorithm to allocate time

From   "Michael Ralph M. Abrigo" <>
Subject   st: algorithm to allocate time
Date   Thu, 7 Jun 2012 13:17:14 +0800

Hi everyone,

I'm working with pilot time-use survey (TUS) data from my country.
Unlike in other TUSs where a primary activity is specified, in our
case all activities and time are listed without regard to which
activity is the primary activity for a given time. I need to allocate
time spent on multiple activities to each of these activities, such
that time spent on all activities will equal 24 hours for a day.
Without additional information, I am thinking of just splitting the
time spent on multiple activities equally among activities. However I
have no idea how to automate it in Stata. A sample of the data is as

id startampm starthour startminute endampm endhour endminute actvty
1  am        10        1           am      10      30        911
1  am        10        15          am      11      45        832
1  am        11        0           am      11      30        465
1  am        11        30          pm      1       45        223
1  pm         1        30          pm      2       30        911

id - respondent id
*ampm - if activity (started/ended) in am or pm
*hour - hour activity (started/ended)
*minute - minute activity (started/ended)
actvty - is a number code of the activity done

I hope to hear your suggestions. Thank you in advance.

With best,

*   For searches and help try:

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