calc_time_btw_active_events: Calculate time between active paradata events

View source: R/paradata.R

calc_time_btw_active_eventsR Documentation

Calculate time between active paradata events

Description

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.

Usage

calc_time_btw_active_events(dt)

Arguments

dt

Data table of the form produced by parse_paradata.

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

Value

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


arthur-shaw/susopara documentation built on Oct. 11, 2023, 5:56 p.m.