Builds an X -> M -> Y mediation diagram with an optional direct effect and an optional latent confounder of the mediator and the outcome. The interpretive badge controls whether the diagram licenses a causal reading.
Usage
umg_mediation(
x = "X",
m = "M",
y = "Y",
direct = TRUE,
confounder = FALSE,
badge = c("statistical", "structural"),
plate_index = "i = 1, ..., N"
)Examples
plot(umg_mediation(confounder = TRUE, badge = "structural"))