Skip to contents

R 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_aggregate denominator.

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:

row

per-placement rate (b01 row count)

individual_any

share of within-year individuals with any placement satisfying the criterion

individual_cumulative

share of within-year individuals whose cumulative within-year segregation days exceeds the threshold

c11_aggregate

the duration-band aggregate from c11 (requires c11_data to be supplied)

Meaningful-contact proxies (Rule 44, derived from b01 alert flags):

none

Rule 43 only; no contact proxy applied

any_alert

Rule 43 AND (any of MH/SR/SW alert active); these placements receive staff contact, so this is the looser contact-failure proxy

no_alert

Rule 43 AND (no alert active); strictest contact-failure proxy

References

United Nations General Assembly (2015). United Nations Standard Minimum Rules for the Treatment of Prisoners (the Nelson Mandela Rules). A/RES/70/175. Rule 43 = prolonged (more than 15 days). Rule 44 = at least 22 hours/day, no meaningful human contact.

Examples

if (FALSE) {
  b01 <- read.csv("b01_segregation_detailed_dataset.csv")
  spec <- mrm_otis_mandela_spectrum(b01)
  head(spec)
}