*! version 1.0 30Jun2024∫
help timeuse

Syntax

timeuse var, diaryid(string)

Description

timeuse -- transforms an episode file into a diary-level file containing basic time use information,
such as total time spent on the activity and the number of episodes for the different categories of activities contained in 'var'.
If you are interested in the timing of the activities, see the program timeusex.
It may be a good idea to run epichecks before using this program, because if there were any errors in 'start' and/or 'end,' the program may not produce the desired results.

Arguments

var: categorical variable capturing the activity. The categories of 'var' do not need to be labelled but it is recommended that they are. 'var' can have missing values but no negative values are allowed. If missing values take values below zero, make sure you recode them before running the command.

diaryid(string): the names of the variable or variables that when considered jointly uniquely identify the diary.

Variables that need to exist

The following variables do need to exist in order for the program to work since the ado file will call them at some point. If, as you should, you are working with diary data, these variables must exist, simply rename them.

start: start time of the episode expressed as minute of day. "start" can take values from 0 to 1439. The first episode of the diary should start at minute 0.

end: end time of the episode expressed as minute of day. "end" can take values from 1 to 1440. The last episode of the diary should end at minute 1440.

Outcomes

The program creates a diary level file with the following variables:

var_1 to var_n: variables containing total time spent on each of the 1 to N categories of activity.

var_1_n to var_N_n: number of episodes for each of the 1 to N categories of 'var'.

Examples

The following example loads the dataset "diary.dta" and runs the program timeuse to create a diary level file with time use information for the categories of activity included in the variable primary.
After running the problem a small report will be displayed in the results window that will tell the user whether or not the variables created containing the time spent on each category of activity add up to 1440 or not. That the categories of activity do not add up to 1440 is not necessarily a problem. Datasets often have missing values and in those cases, it is expected that the sum of the different activities does not add up to 1440 minutes.
Describing the package, ssc describe timeuse may be needed before loading the example datasets.

Example 1: time spent across the different categories of 'primary'

In this example, primary has missing values and as a result, the sum of the different categories of activity created does not add up to 1440.

. net get timeuse

. use diary, clear

. timeuse primary, diaryid(personid diaryid)

Example 2: time spent outdoors and indoors

To have categories of activity adding up to 1440 minutes, we give valid values to the missing values in the variable 'inout'.

. net get timeuse

. use diary, clear

. lab define inout 4 unknown, modify

. recode inout (.=4)

. timeuse inout, diaryid(personid diaryid)

Author:

Juana Lamote de Grignon Pérez, Centre for Time Use Research (UCL), juana.lamote@gmail.com

Thanks for citing this software as follows:

Lamote de Grignon, J. (2024). timeuse: Stata package to facilitate the manipulation of diary-based time-use data. Available from: https://ideas.repec.org/c/boc/bocode/s459346.html.

Acknowledgments

I am grateful to Elena Mylona and Margarita Vega Rapún for their feedback during the development of the program.