
Alert-state combination encoding (8 combos -> complexity index)
Source:R/otis.R
morie_otis_astcmb.RdEncodes 3 binary alert flags into 8 combinations (a1..a8) and
aggregates per (id, fiscal year), computing a complexity index
ac = number of distinct combinations observed.
Usage
morie_otis_astcmb(
df,
alert_cols = c("mental_health_alert", "suicide_risk_alert", "suicide_watch_alert"),
id_col = "unique_individual_id",
year_col = "end_fiscal_year"
)Examples
df <- morie_synth_otis("b01", n = 120L, seed = 6L)
res <- try(morie_otis_astcmb(df))