Hi,
I have episode file of time use showing population's activity code and
duration. In this data, an activity longer than 30 mins (e.g. sleep)
has multiple episodes, that creates unrealistically larger number of
activities in one day. I want to keep one record per activity if the
code is repeated in next row and generate combine duration for that
activity. for example, code '11' has been repeated in three
episodes/rows, but it should be in one row with duration=90, how can i
do that!
person starttime episode duration code
1 11/25/2007 4:00 1 30 11
1 11/25/2007 4:30 2 30 11
1 11/25/2007 5:00 3 30 11
1 11/25/2007 5:30 4 15 30
1 11/25/2007 5:45 5 15 60
1 11/25/2007 6:00 6 30 60
1 11/25/2007 6:30 7 30 60
1 11/25/2007 7:00 8 15 413
1 11/25/2007 7:15 9 15 412
1 11/25/2007 7:30 10 30 412
1 11/25/2007 8:00 11 15 412
1 11/25/2007 8:15 12 15 20
1 11/25/2007 8:30 13 15 413
1 11/25/2007 8:45 14 15 413
1 11/25/2007 9:00 15 30 413
Best regards
Muhammad Adeel
The University of Hong Kong
--
Muhammad Adeel
Room 841 A, ,8F. Knowles building
Department of Urban Planning and Design
The University of Hong Kong
Pokfulam road, Hong Kong SAR
Cell: 0085254894670
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/