Creates a forest plot comparing parameter estimates from either: - a single model with one parameter set. - a single model with two different parameter sets. - two different models with matching parameters.
forestplot_compare(
model1,
model2 = NULL,
pars,
pars2 = NULL,
plotmath.labels = NULL,
plotmath.labels2 = NULL,
study.labels = NULL,
consolidate.param.labels = FALSE,
model1.name = "Model 1",
model2.name = "Model 2",
model.legend.title = "Model",
ref.lines = c(0),
colors = c("blue", "red"),
point.size = 3,
point.shapes = c(16, 17),
prob = 0.5,
prob.outer = 0.9,
point.est = "median",
x.lab = "Estimate",
y.lab = NULL,
inner.line.thickness = 1.5,
outer.line.thickness = 0.5,
x.lim = NULL,
param.distance = 0.3,
group.spacing = 1,
flip.coords = FALSE,
x.label.angle = 0,
study.label.size = 11,
...
)First model object. Can be an `mcmc.list` object, a model with BUGS output, a matrix, or a data frame of MCMC draws.
Optional second model object. If omitted, the function can compare two parameter sets within model1. Accepted types are the same as `model1`.
Character vector of parameter names for the first model or first parameter set
Optional character vector of parameter names for the second parameter set in model1. Ignored if model2 is provided.
Optional vector of plotmath expressions as strings to label parameters in the first model or set.
Optional vector of plotmath expressions for parameters in the second parameter set in model1.
Optional character vector of labels to use for studies on the y-axis. If provided, these labels will replace parameter names, and each study label will correspond to a pair of estimates.
Logical. If `TRUE` and `study.labels` is `NULL` for comparison plots, displays a single consolidated label for the parameter pair. If `FALSE` (default), displays a label for each individual parameter. Ignored for single model plots.
Label for the first model in the plot legend.
Label for the second model or parameter set in the legend.
Title for the model legend.
Numeric vector of vertical reference lines to display.
Vector of colors for each model or parameter set.
Size of point estimate markers.
Shapes used for points corresponding to each model or set
Width of the inner credible interval (e.g. 0.5 for 50 % interval).
Width of the outer credible interval (e.g. 0.9 for 90% interval).
Which point estimate to use: "median" or "mean", default is "median".
Label for the x-axis.
Label for the y-axis.
Thickness of inner credible interval lines.
Thickness of outer credible interval lines.
Optional numeric vector of length two to fix x-axis limits.
Numeric, controls the vertical distance between points for different models/parameter sets within the same study. Default is 0.3.
Numeric, controls the vertical spacing between different studies/group of parameters. Default is 1.
Logical, if TRUE, flips the x and y axes, creating a horizontal plot. Default is FALSE.
Numeric. Angle for x-axis labels when `flip.coords = TRUE`. Default is 0.
Numeric. Text size for study or parameter labels on the y-axis (or x-axis if flipped).
...