I'm working with ISTAT dataset "use of time". I just want to run some basic analysis but I'm not an expert STATA user so I'm quite lost... I want to thank in advance those who can help me.
The dataset has one record for each episode (codified as a number) reported by the respondent in the daily diary, as in the following table:
n_family | n_component | activity | start_hour | start_minute | finish_hour | min_finish |
1 | 1 | 52 | 7 | 10 | 9 | 00 |
1 | 1 | 22 | 17 | 50 | 18 | 00 |
1 | 2 | 11 | 20 | 00 | 21 | 00 |
1 | 3 | 27 | 5 | 25 | 6 | 25 |
What I would like to do is to have, for each individual, a variable that indicates how much time he/she spend doing each activity (but I still don't have a variable that uniquely identifies the observations).
I created two new variables indicating the starting and finishing time. For example, for row1 I created a variable "start" with content "7:10" and a variable "finish" with content "9:00" in this way:
Code:
gen start = string(start_hour) + ":" + string(start_minute) gen finish = string(finish_hour) + ":" + string(finish_minute)
Code:
encode start, gen (start_num) encode finish, gen (finish_num)
Thank you!
Giulia
0 Response to use of time: duration
Post a Comment