Fraction of entities (irrespective of group) that receive service
within a defined time window. A value below 0.80 is treated as
a critical compliance violation.
Usage
compute_compliance_index(
entities,
window_min = 60,
window_unit = c("min", "hours", "days"),
by_scenario = TRUE,
by_group = TRUE,
n_bootstrap = 1000
)Arguments
- entities
A
dynasimR_dataobject, or an entity-level tibble/data.frame with atime_to_first_servicecolumn (Profile A) orwait_days_to_mincolumn (Profile B).- window_min
Numeric. Window size, expressed in the unit given by
window_unit. Default60.- window_unit
Character. One of
"min","hours","days". Values are internally normalised to minutes.- by_scenario
Logical. Compute per scenario. Default
TRUE.- by_group
Logical. Stratify by
groupif the column is present. DefaultTRUE.- n_bootstrap
Integer. Bootstrap replicates for CIs. Default
1000.
Value
A tibble with columns scenario (if stratified),
group (if stratified), ci, ci_ci_lo, ci_ci_hi,
n_total, n_in_window, compliance_critical, window_min.
Details
For Profile B data the analogous metric uses wait_days with a
14-day window (window_unit = "days").
Examples
if (FALSE) { # \dontrun{
sim <- load_example_data()
ci <- compute_compliance_index(sim)
} # }