Mandela Rules apples-to-apples spectrum on OTIS b01
Source:R/mrm_mandela_spectrum.R
mrm_otis_mandela_spectrum.RdR parity of morie.mrm_otis_mandela_spectrum(). Computes a
full grid of provincial Mandela-classified rates across four
denominator conventions x three meaningful-contact proxies, so the
Cross-jurisdiction comparison table in the MRM formulations
paper (Section 5.3) can be reproduced from a single function call.
Usage
mrm_otis_mandela_spectrum(
data,
duration_col = "NumberConsecutiveDays_Segregation",
year_col = "EndFiscalYear",
id_col = "UniqueIndividual_ID",
threshold_days = 15L,
alert_cols = c("MentalHealth_Alert", "SuicideRisk_Alert", "SuicideWatch_Alert"),
contact_proxies = c("none", "any_alert", "no_alert"),
denominators = c("row", "individual_any", "individual_cumulative"),
c11_data = NULL
)Arguments
- data
OTIS b01 data.frame.
- duration_col, year_col, id_col
Column names.
- threshold_days
Rule 43 duration threshold (UN: 15 days).
- alert_cols
Three b01 alert columns (
"Yes"= active).- contact_proxies
Subset of
c("none","any_alert","no_alert").- denominators
Subset of
c("row","individual_any", "individual_cumulative","c11_aggregate").- c11_data
Optional c11 aggregate frame for the
c11_aggregatedenominator.
Value
Tidy long-format data.frame with one row per
(year, denominator, contact_proxy) cell, columns
year, denominator, contact_proxy,
n_eligible, n_mandela, rate, pct.
Details
Denominator conventions:
rowper-placement rate (b01 row count)
individual_anyshare of within-year individuals with any placement satisfying the criterion
individual_cumulativeshare of within-year individuals whose cumulative within-year segregation days exceeds the threshold
c11_aggregatethe duration-band aggregate from c11 (requires
c11_datato be supplied)
Meaningful-contact proxies (Rule 44, derived from b01 alert flags):
noneRule 43 only; no contact proxy applied
any_alertRule 43 AND (any of MH/SR/SW alert active); these placements receive staff contact, so this is the looser contact-failure proxy
no_alertRule 43 AND (no alert active); strictest contact-failure proxy