Skip to contents

This function interprets the output of causal effect analysis, providing a compact report. It only reports coefficients and E-values with **Evidence** or **Strong evidence** for causality, unless all estimates with E_Value > 1 (and E_Val_bound > 1) are requested. Each outcome's interpretation starts with a separate paragraph heading using `####`. Additionally, it includes a final paragraph indicating that all other effect estimates presented either weak or unreliable evidence for causality.

Usage

margot_interpret_marginal(
  df,
  type = c("RD", "RR"),
  order = "alphabetical",
  original_df = NULL,
  interpret_all_E_gt1 = FALSE
)

Arguments

df

Data frame containing causal effect estimates. Expected to include columns for outcome names, effect estimates, confidence intervals, E-values, and summary labels.

type

Character string specifying the type of effect estimate. Must be either "RD" (Risk Difference) or "RR" (Risk Ratio). Default is "RD".

order

Character string specifying the order of results. Default is "alphabetical". - `"alphabetical"`: Orders outcomes alphabetically. - `"magnitude"`: Orders outcomes by the absolute magnitude of the effect size in descending order.

original_df

Optional data frame for back-transforming estimates to the original scale.

interpret_all_E_gt1

Logical. If `TRUE`, interprets any effect estimate with an `E_Value` > 1 and a lower E-value bound > 1. Default is `FALSE`.

Value

A list containing one element:

interpretation

A character string containing a compact interpretation of each outcome in `df`, including separate paragraph headings and sentence-cased descriptions, followed by a concluding paragraph if applicable.

Examples

if (FALSE) { # \dontrun{
result <- margot_interpret_marginal(group_tab_output, type = "RD", interpret_all_E_gt1 = TRUE)
cat(result$interpretation)
} # }