orchard_leave1out: Orchard Plot for Leave-One-Out Analysis

View source: R/orchard_leave1out.R

orchard_leave1outR Documentation

Orchard Plot for Leave-One-Out Analysis

Description

Plots the output of a leave-one-out analysis for a meta-analytic model. The plot displays the effect sizes, overall effect estimate (with confidence and prediction intervals), and optionally, the effect sizes left out ("ghost points") in each iteration. In addition, the original model's 95% confidence limits are shown as reference lines.

Usage

orchard_leave1out(
  leave1out,
  ylab = NULL,
  ci_lines = TRUE,
  ci_lines_color = "red",
  ghost_points = TRUE,
  angle = 0,
  g = FALSE,
  transfm = c("none", "tanh", "invlogit", "percent", "percentr"),
  ...
)

Arguments

leave1out

Output from leave_one_out(), containing the leave-one-out analysis results.

ylab

Optional label for the y-axis, which lists the elements left out.

ci_lines

Logical indicating whether to add horizontal reference lines (default is TRUE) representing the original model's 95% confidence intervals.

ci_lines_color

Character string specifying the color for the confidence interval lines (default is "red").

ghost_points

Logical indicating whether to add "ghost points" for the effect sizes that were left out. These are plotted as empty points (default is TRUE).

angle

Numeric value specifying the angle of the x-axis labels in degrees (default is 0).

g

Logical indicating whether to return the plot as a grob object (default is FALSE).

transfm

Character string specifying the transformation to apply to the data. Options are: "none" (default, no transformation), "tanh" (hyperbolic tangent), "invlogit" (inverse logit), "percent" (percentage), or "percentr" (percentage range).

...

Additional arguments passed to orchard_plot.

Details

This function is useful to see how sensitive is the overall effect size estimated by a meta-analytic model to exclusion of each element from a group.

The y-axis shows the elements from the group. For each one, the plot shows the result from the model that left-out that element. For each model, the plot shows the effect sizes, overall effect estimate with confidence and prediction intervals, and "ghost points". This "ghost points" are the effect sizes left out and they are shown as empty points. They can be ommited setting 'ghost_points' to FALSE.

The plot also shows 95 as red dotted lines. The arguments 'ci_lines' and 'ci_lines_color' allow to remove this lines or select their color.

The function internally sets a color palette for the plot. If more than 20 elements are in the group, a viridis palette is used. Otherwise, a color-blind friendly palette is applied by default.

Value

A ggplot2 object displaying the leave-one-out analysis with reference lines for the original model's confidence limits.

Author(s)

Facundo Decunta - fdecunta@agro.uba.ar

Examples

## Not run: 
  # Fit a multivariate meta-analytic model using the metafor package
  res <- metafor::rma.mv(lnrr, lnrr_vi, random = ~ 1 | paper_ID, data = fish)
  loo_res <- orchaRd::leave_one_out(res, group = "paper_ID")
  orchard_leave1out(leave1out = loo_res, xlab = "lnRR")

## End(Not run)


daniel1noble/orchaRd documentation built on April 17, 2025, 3:59 a.m.