Skip to contents

This function now accepts a vector of model names to process and produces a single combined output. The common description is printed once at the top, followed by each model's specific findings. You can now control whether to interpret the depth-1 or depth-2 tree via the `max_depth` argument.

Usage

margot_interpret_policy_batch(
  models,
  model_names = NULL,
  max_depth = 2L,
  save_path = NULL,
  prefix = NULL,
  include_timestamp = FALSE,
  ...
)

Arguments

models

A list containing the results from multi-arm causal forest models.

model_names

A character vector of model names to interpret. If NULL, all models are processed.

max_depth

Integer, 1 or 2; which saved policy tree to interpret (default 2).

save_path

The path where the combined interpretation will be saved. If NULL, nothing is saved.

prefix

An optional prefix for the filename.

include_timestamp

Logical; whether to include a timestamp in the filename (if desired).

...

Additional arguments to pass to margot_interpret_policy_tree(), including include_conditional_means (default TRUE) to add conditional means interpretation, use_math_notation (default FALSE) for clear, simple output format, output_format ("bullet" or "prose") for different text styles, and original_df to display CATEs on the original data scale.

Value

A single character string containing the combined markdown output.