View source: R/plot_sensitivity.R
| plot_sensitivity | R Documentation |
Renders the novel bivariate robustness map unique to RobustMediate: a 2-D heatmap where the x-axis is the E-value (VanderWeele-style unmeasured treatment–outcome confounding) and the y-axis is Imai's sequential-ignorability violation parameter rho. Contour lines show where the mediation effect crosses zero, so readers can judge robustness to two different sensitivity dimensions simultaneously.
This visualisation does not exist elsewhere in the R ecosystem. The correct interpretation is as a bivariate robustness display, not a joint causal model — see the package paper for theoretical justification.
plot_sensitivity(
x,
annotate_zero = TRUE,
n_breaks = 12,
palette = "RdYlGn",
...
)
x |
A |
annotate_zero |
Logical. Draw a bold dashed zero-crossing contour?
Default |
n_breaks |
Number of fill colour breaks in the heatmap. Default |
palette |
RColorBrewer palette name. Default |
... |
Ignored. |
A ggplot2 object.
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_sensitivity(fit)
plot_sensitivity(fit, annotate_zero = FALSE, palette = "PuOr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.