Skip to contents

Aggregates per-force incident counts and reports a Hill-MLE Pareto tail exponent, the Gini coefficient, and the top-5 / top-10 concentration shares.

Usage

mrm_uof_force_concentration(df, force_col, count_col = NULL)

Arguments

df

A data.frame or tibble with one row per incident (when count_col is NULL) or one row per force-period with a numeric count_col.

force_col

Character. Name of the column identifying the force / service / agency.

count_col

Character or NULL. If supplied, the per-row incident count to sum within each force; otherwise each row counts as one incident.

Value

A named list with classes morie_mrm_uof_result, morie_rich_result, list. Numeric outputs include pareto_alpha_mle, gini, top5_share, top10_share, n_forces, n_incidents.

Examples

df <- data.frame(force = c(rep("A", 50), rep("B", 5)))
res <- mrm_uof_force_concentration(df, "force")
res$gini
#> [1] 0.4090909