Skip to contents

Encodes 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"
)

Arguments

df

data.frame with the three alert columns and id/year cols.

alert_cols

Character-3 of alert column names. Default mirrors the lower-case Python schema.

id_col, year_col

Column names.

Value

morie_otis_result.