Skip to contents

Computes the pairwise Cramer's V (and chi-square test) for every pair of the three OTIS b01 alert columns. The MentalHealth x SuicideRisk Cramer's V is the substantive "mortification co-occurrence" figure used in the MRM paper.

Usage

mrm_otis_mortification_cooccurrence(
  data,
  alert_cols = c("MentalHealth_Alert", "SuicideRisk_Alert", "SuicideWatch_Alert")
)

Arguments

data

A data.frame with at least the three alert columns.

alert_cols

Character vector of alert column names (default the three b01 alert columns).

Value

A data.frame with one row per pair, columns alert_a, alert_b, n, chi2, df, p_value, morie_cramers_v.

Details

Values are computed by treating "Yes" as 1 and any other value as 0; rows with NA in either alert column are dropped from that pair.

Examples

if (FALSE) {
  b01 <- read.csv("b01_segregation_detailed_dataset.csv")
  mrm_otis_mortification_cooccurrence(b01)
}