Skip to contents

This function combines either “causal forest” or “lmtp” batched model outputs into a single object, provided they share compatible structures.

Usage

margot_bind_models(..., quiet = FALSE)

Arguments

...

One or more batched model output objects.

quiet

Logical; if TRUE, suppresses CLI feedback messages. Default is FALSE.

Value

A single combined model output object.

Details

- If all inputs have the four elements `models`, `contrasts`, `individual_tables` and `combined_tables`, it assumes an **lmtp**‐style object and flattens each list, row‐binding the `combined_tables`. - Otherwise it falls back on the original “causal forest” structure with elements `results`, `combined_table`, `outcome_vars`, `not_missing` and `full_models`. - It checks that any `not_missing` vectors match exactly across inputs.

Examples

# for lmtp outputs
combined_lmtp <- margot_bind_models(
  health_lmtp_output,
  psych_lmtp_output
)
#> Error: object 'health_lmtp_output' not found

# for causal forest outputs
combined_cf <- margot_bind_models(
  models_binary_social,
  models_binary_psych
)
#> Error: object 'models_binary_social' not found