In order to get the results, I will firstly clarify the research setting to help you understand: here is a pitch data, firstly presenting session, and then QA session.
Each presenting team has different numbers of presenters (presenterNum), for example, observation 1 has 1 presenter; observation 2 has 3 presenters, observation 5 has 3 presenters. prsterOrder indicates the order of presenters who speak up, for example, observation1 indicates only presenter 1 speak up; observation 5 indicates presenter 1 firstly speak up and then presenter 3 continued to speak up, and presenter 2 didn’t speak up.
I want to calculate the time duration of first/second… speakers, and also want to calculate the time duration of presenter 1, 2, 3… respectively.
*Time variables is the clock time. prster1Time indicates the beginning time of presenter 1, queston1Time indicates the beginning time of QA session.
For observation 1, the time duration of first speaker is (14:21-08:21). For presenter 1, the time duration is (14:21-08:21)
For observation 2, the time duration of first speaker is (43:40-36:41). For presenter 1, the time duration is (43:40-36:41), while for presenter 2 and 3, the time durations are 0 since they just showed up but without speaking.
For observation 5, the time duration for presenter 1 is (56:56-53:00+03:32-0:00), the time duration for presenter 2 is 0, and the time duration for presenter 3 is (03:55-03:32)
For observation 11, the time duration for presenter 1 is (22:30-17:07), the time duration for presenter 2 is (23:19-22:30); the time duration of presenter 3 is 0. The time duration of first speaker is (22:30-17:07), the time duration of second speaker is (23:19-22:30).
This syntax is not right, just as a beginning for you: gen prster1Duration = (clock(question1Time,"ms") - clock(prster1Time,"ms"))/1000/60
Each presenting team has different numbers of presenters (presenterNum), for example, observation 1 has 1 presenter; observation 2 has 3 presenters, observation 5 has 3 presenters. prsterOrder indicates the order of presenters who speak up, for example, observation1 indicates only presenter 1 speak up; observation 5 indicates presenter 1 firstly speak up and then presenter 3 continued to speak up, and presenter 2 didn’t speak up.
I want to calculate the time duration of first/second… speakers, and also want to calculate the time duration of presenter 1, 2, 3… respectively.
*Time variables is the clock time. prster1Time indicates the beginning time of presenter 1, queston1Time indicates the beginning time of QA session.
For observation 1, the time duration of first speaker is (14:21-08:21). For presenter 1, the time duration is (14:21-08:21)
For observation 2, the time duration of first speaker is (43:40-36:41). For presenter 1, the time duration is (43:40-36:41), while for presenter 2 and 3, the time durations are 0 since they just showed up but without speaking.
For observation 5, the time duration for presenter 1 is (56:56-53:00+03:32-0:00), the time duration for presenter 2 is 0, and the time duration for presenter 3 is (03:55-03:32)
For observation 11, the time duration for presenter 1 is (22:30-17:07), the time duration for presenter 2 is (23:19-22:30); the time duration of presenter 3 is 0. The time duration of first speaker is (22:30-17:07), the time duration of second speaker is (23:19-22:30).
This syntax is not right, just as a beginning for you: gen prster1Duration = (clock(question1Time,"ms") - clock(prster1Time,"ms"))/1000/60
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte presenterNum str6(prster1Time prster1EndTime prster2Time prster2EndTime prster3Time) str1 prster3EndTime str6 question1Time str2 prsterOrder 1 " 08:21" "" "" "" "" "" " 14:21" "1" 3 " 36:41" "" "" "" "" "" " 43:4" "1" 2 " 22:31" "" "" "" "" "" " 28:59" "1" 2 " 17:16" "" "" "" "" "" " 24:34" "1" 3 " 53:00" "56:56 " "" "" " 03:32" "" " 03:55" "13" 1 " 00:00" "" "" "" "" "" " 05:15" "1" 2 " 00:03" "" "" "" "" "" " 06:50" "1" 2 " 18:35" "" "" "" "" "" " 29:11" "1" 3 " 33:31" "" "" "" "" "" " 42:02" "1" 2 " 36:37" "" "" "" "" "" " 43:38" "1" 3 " 22:30" "" " 17:07" "" "" "" " 23:19" "21" 2 " 15:25" "" "" "" "" "" " 26:58" "1" 2 " 58:05" "58:51 " "" "" "" "" " 04:24" "1" 2 " 53:46" "54:42 " "" "" "" "" " 07:39" "1" 3 " 33:06" "41:09 " "" "" "" "" " 03:27" "1" 3 " 19:12" "" "" "" "" "" " 27:48" "1" 2 " 23:34" "31:24 " "" "" "" "" " 00:32" "1" 2 " 11:45" "" "" "" "" "" " 19:36" "1" 2 " 01:57" "" "" "" "" "" " 10:21" "1" 2 " 08:25" "" "" "" "" "" " 16:48" "1" 2 " 02:40" "" "" "" "" "" " 10:34" "1" 2 " 26:04" "" "" "" "" "" " 34:21" "1" 2 " 22:42" "" "" "" "" "" " 33:57" "1" 2 " 15:37" "" "" "" "" "" " 24:03" "1" 2 " 07:34" "" "" "" "" "" " 15:35" "1" 2 " 04:51" "" "" "" "" "" " 11:48" "1" 2 " 18:16" "" "" "" "" "" " 26:41" "1" 1 " 30:49" "" "" "" "" "" " 39:07" "1" 2 " 02:09" "" "" "" "" "" " 09:35" "1" 2 " 00:06" "" "" "" "" "" " 08:14" "1" 2 " 14:23" "" "" "" "" "" " 22:36" "1" 2 " 25:28" "" "" "" "" "" " 35:49" "1" 2 " 30:47" "32:42 " " 01:30" "" "" "" " 06:00" "12" end

Comment