Skip to contents

Plot fitted indirect effects, the total indirect effect, the direct effect (cp) and the total effect with their stored confidence intervals. With a moderator these are effects at the model's reference value (centered continuous W = 0, or the reference category), not averages across W. Use plot_conditional_effects() to show selected moderator levels instead.

Usage

plot_effects(
  result,
  paths = NULL,
  standardized = FALSE,
  engine = c("mc", "boot"),
  labels = NULL,
  title = NULL,
  x_label = NULL,
  y_label = NULL,
  base_size = 12
)

Arguments

result

A result returned by wsMed().

paths

Optional character vector of effect identifiers, in display order. NULL selects all available effects. Both indirect_1 and indirect_effect_1 are accepted when they identify an available effect.

standardized

Use standardized results, requested when fitting with standardized = TRUE. No scaling is recomputed from interval endpoints.

engine

For ci_method = "both", select "mc" or "boot". For a single engine its stored results are used.

labels

Optional named character vector mapping effect identifiers to display labels. Partial mappings are allowed.

title

Optional plot title.

x_label, y_label

Optional axis labels.

base_size

Base font size.

Value

A ggplot object. Its data contains the plotted estimates and CI.LL/CI.UL limits. The wsmed_plot attribute records the selected engine, scale and confidence level. Use ggplot2::ggsave() to export it.

Details

MC intervals come from the parameter draws (or the stored standardized parameter table). Bootstrap plots use the bootstrap limits, not the normal-theory limits that may also be present in the table. New workflow objects use wsmed_plots. Both interfaces expose full-precision estimate, conf.low, and conf.high columns in the plotted data; legacy column names remain available. Interval conventions are not silently changed.