Skip to contents

Visualises the fitted posterior effect through time for a clusters_results_1d object. The plot shows:

  • the posterior mean (x$predictions$post_prob) as a line,

  • its uncertainty interval (x$predictions$lowerx$predictions$upper) as a ribbon,

  • and detected significant clusters (x$clusters) as thick horizontal segments.

Usage

# S3 method for class 'clusters_results_1d'
plot(
  x,
  null_value = 0,
  clusters_y = -Inf,
  clusters_colour = "black",
  lineend = "butt",
  theme = ggplot2::theme_bw(),
  ...
)

Arguments

x

A clusters_results_1d object (typically returned by testing_through_time for 1D time).

null_value

Numeric. Reference value shown as a horizontal dashed line. Defaults to 0.

clusters_y

Numeric. Vertical position used to draw the cluster segments. Defaults to -Inf (draws at the bottom of the panel).

clusters_colour

Character. Colour used for the prediction line/ribbon and the cluster segments. Defaults to "black".

lineend

Character. Line end style for cluster segments, passed to geom_segment (e.g., "butt", "round").

theme

A ggplot2 theme object. Defaults to theme_bw().

...

Currently unused. Included for S3 compatibility.

Value

A ggplot object.

Details

When possible (depending on x$multilevel and the structure of x$model$data), the method also reconstructs and overlays an empirical time course (e.g., averaged outcome or difference between two predictor levels).

If clusters are available at the participant level (i.e., a participant column exists in x$clusters), the plot is facetted by participant.

Examples

if (FALSE) { # \dontrun{
res <- testing_through_time(...)
plot(res)
} # }