Skip to contents

Demographic disparity in outcome rates with risk-ratio CIs

Usage

mrm_uof_demographic_disparity(
  df,
  demo_col,
  outcome_col,
  baseline = NULL,
  bootstrap_reps = 0L
)

Arguments

df

A data.frame.

demo_col

Categorical demographic column.

outcome_col

Binary outcome column (0/1 or logical).

baseline

Optional baseline category (default: largest-N group).

bootstrap_reps

Bootstrap replications for the RR percentile CI. Set to 0 (default) to skip.

Value

Named list with baseline, baseline_rate, per_category (list of lists), risk_ratios.

Examples

eth <- morie_datasets_corrections_uof_ethnic_origin()
res <- mrm_uof_demographic_disparity(eth, names(eth)[2], names(eth)[3])
res$title
#> [1] "MRM-UOF Demographic Disparity"