Computes duration as the difference between the timestamps of active events. To do so, this subsets to active events, computes durations, and handles some edge cases.

calc_time_btw_active_events(dt)

Arguments

dt

Data table of the form produced by parse_paradata.

Value

Data table of active events with two new columns: elapsed_sec and elapsed_min

Details

Determines active event durations by:

  • Filtering out passive and non-interview events

  • Computing difference between active events

Passive events include:

  • Events of the following types in event: c("ApproveByHeadquarter", "ApproveBySupervisor", "ClosedBySupervisor", "KeyAssigned", "OpenedBySupervisor", "QuestionDeclaredInvalid", "QuestionDeclaredValid", "ReceivedByInterviewer", "ReceivedBySupervisor", "RejectedByHeadquarter", "RejectedBySupervisor", "SupervisorAssigned", "TranslationSwitched", "UnapproveByHeadquarters", "VariableDisabled", "VariableSet")

  • Pauses in the interview--that is, time between Pause and Resume events

  • End and resumption of the interview--that is between events and Restarted or between Restarted and an event

All other events are considered active