| plot_balance | R Documentation |
Produces a publication-ready love plot showing standardised mean differences (SMDs) before and after IPW weighting for both the treatment and mediator pathways — stacked vertically in a single panel. This dual-pathway display is unique to RobustMediate; no other mediation package provides it.
plot_balance(x, threshold = 0.1, pathways = c("treatment", "mediator"), ...)
x |
A |
threshold |
Absolute SMD threshold displayed as dashed reference lines.
Reviewers conventionally accept |SMD| < 0.10. Default |
pathways |
Character vector indicating which pathways to show.
Options: |
... |
Ignored (for S3 consistency). |
A ggplot2 object. Add layers or themes as usual.
fit <- robustmediate(
treatment_formula = X ~ Z1 + Z2 + Z3,
mediator_formula = M ~ X + Z1 + Z2 + Z3,
outcome_formula = Y ~ X + M + Z1 + Z2 + Z3,
data = sim_mediation, R = 50
)
plot_balance(fit)
plot_balance(fit, threshold = 0.05, pathways = "treatment")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.