Learn R Programming

ivd (version 1.0.0)

plot.ivd: Plot method for ivd objects

Description

Plot method for ivd objects

Usage

# S3 method for ivd
plot(
  x,
  type = "pip",
  pip_level = 0.75,
  variable = NULL,
  label_points = TRUE,
  ...
)

Value

Invisibly returns a ggplot object corresponding to the selected plot type. The primary purpose of this method is the side effect of displaying the plot.

The exact plot depends on the value of type:

  • "pip" — Posterior inclusion probability plot for random scale effects.

  • "funnel" — Funnel plot showing the relation between within-cluster standard deviation (tau) and posterior inclusion probabilities.

  • "outcome" — Outcome plot relating cluster means (mu), posterior inclusion probability, and within-cluster SD.

When label_points = TRUE, labels for clusters exceeding the pip_level threshold are added using ggrepel (if available).

Arguments

x

An object of type ivd.

type

Defaults to 'pip', other options are 'funnel' and 'outcome'.

pip_level

Defines a value for the posterior inclusion probability. Defaults to 0.75.

variable

Name of a specific variable. Defaults to NULL

label_points

Should points above the pip threshold be labelled? Defaults to TRUE.

...

Controls ggrepel aruments.

Author

Philippe Rast