Overlays multiple consonance or surprisal functions on a single plot for direct visual comparison of effect estimates across groups, time periods, or studies.
plot_multi(..., type = "c", measure = "default", nullvalue = NULL,
position = "pyramid", title = "Comparison of Consonance Functions",
subtitle = "Functions display intervals at every level.",
xaxis = expression(theta == ~"Effect Size"),
yaxis1 = expression(paste(italic(p), "-value")),
yaxis2 = "Confidence Level (%)", colors = NULL, alpha = 0.15,
legend.position = "bottom")Named concurve dataframes to compare. Names become legend labels. Alternatively, pass a single named list of dataframes.
Character. Type of function to plot: "c" for consonance (default), "s" for surprisal.
Character. Scale type: "default" for linear, "ratio" for log scale (odds ratios, hazard ratios, etc.).
Numeric. Value(s) to mark with vertical reference line(s). Use single value (e.g., 0) or vector for range (e.g., c(-0.5, 0.5)).
Character. Orientation of consonance function: "pyramid" (default) or "inverted".
Character. Plot title.
Character. Plot subtitle.
Character or expression. X-axis label.
Character or expression. Primary y-axis label.
Character. Secondary y-axis label (for CI levels).
Character vector. Colors for each curve. If NULL, uses colorblind-friendly palette.
Numeric. Transparency for ribbon fill (0-1). Default is 0.15.
Character or numeric vector. Legend position. Default is "bottom".
A ggplot2 object (inheriting from ggplot).
Curve names (passed as named arguments) are automatically used as legend labels.
For example, plot_multi("Study A" = curve1, "Study B" = curve2) will use
"Study A" and "Study B" as labels in the legend.
if (FALSE) { # \dontrun{
# Compare two studies
study1 <- curve_from_se(point = 0.5, se = 0.2, df = 50)
study2 <- curve_from_se(point = 0.8, se = 0.25, df = 80)
plot_multi(
"Study A" = study1[[1]],
"Study B" = study2[[1]],
nullvalue = 0,
title = "Comparison of Treatment Effects"
)
# Using a list
curves_list <- list("Group 1" = study1[[1]], "Group 2" = study2[[1]])
plot_multi(curves_list, type = "s", nullvalue = 0)
} # }