Skip to contents

Convenience wrapper around margot_rate_batch(). Returns two data frames, both sorted by descending RATE Estimate, with reliable results highlighted in bold.

Usage

margot_rate(
  models,
  model_names = NULL,
  policy = c("treat_best", "withhold_best"),
  round_digits = 3,
  highlight_significant = TRUE,
  label_mapping = NULL,
  remove_tx_prefix = TRUE,
  remove_z_suffix = TRUE,
  use_title_case = TRUE,
  remove_underscores = TRUE,
  adjust = NULL,
  alpha = 0.05,
  apply_adjustment = !is.null(adjust),
  seed = 12345
)

Arguments

models

List from margot_causal_forest().

model_names

Optional character vector specifying which models to process. Default NULL (all models).

policy

Character; "treat_best" (default) or "withhold_best".

round_digits

Integer; decimal places (default 3).

highlight_significant

Logical; bold outcomes whose 95 percent CI excludes 0 (default TRUE). Note: Only positive significant effects are bolded, negative effects are not bolded.

label_mapping

Named character vector for converting variable names to readable labels.

remove_tx_prefix

Logical; remove treatment prefix from variable names (default TRUE).

remove_z_suffix

Logical; remove z-score suffix from variable names (default TRUE).

use_title_case

Logical; convert variable names to title case (default TRUE).

remove_underscores

Logical; replace underscores with spaces (default TRUE).

adjust

Character; method for adjusting p-values, passed to stats::p.adjust(). Options include "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". Default is NULL (no adjustment).

alpha

Numeric; significance threshold (default 0.05).

apply_adjustment

Logical; if TRUE, compute p-values and apply adjustment method. If FALSE, just document the adjustment method without recomputing. Default is TRUE when adjust parameter is provided, FALSE otherwise.

seed

Integer; base seed for reproducible RATE computations (default 12345).

Value

A list with elements: * rate_autoc: AUTOC RATE table * rate_qini: QINI RATE table