KM survival of SIU case-to-decision gap per police service
Source:R/mrm_siu.R
mrm_siu_case_to_decision_km.RdComputes the gap (in days) between the incident date and the
Director's decision date for every SIU case, dropping rows where
either date is missing. Reports per-stratum median + IQR + n.
Cases without a decision date as of the snapshot are right-censored
if censor_open_cases = TRUE (default).
Usage
mrm_siu_case_to_decision_km(
data,
incident_col = "date_of_incident_iso",
decision_col = "date_of_director_decision_iso",
service_col = "police_service",
censor_open_cases = TRUE,
min_n = 5L
)Arguments
- data
A data.frame with the SIU case schema.
- incident_col
Column with ISO incident date (default
"date_of_incident_iso").- decision_col
Column with ISO Director's decision date (default
"date_of_director_decision_iso").- service_col
Stratifying jurisdiction column (default
"police_service").- censor_open_cases
Logical (default
TRUE). IfTRUE, rows with missingdecision_colcontribute right-censored observations from incident to the most recent decision date in the data set. IfFALSE, they are dropped.- min_n
Minimum cases per service to retain in the per-service summary (default
5L).
Value
A list with elements:
pooled: a single-row data.frame with the pooled median, mean, IQR, n, n_censored.by_service: per-service data.frame with the same columns.