Learn R Programming

jarbes (version 2.5.0)

plot.bcmeta: Generic plot function for bcmeta object.

Description

This function is built with `ggplot2`. Parameters such as `binwidth`, `adjust`, `density.color`, `density.lwd`, `density.lty`, and `density.alpha` correspond directly to arguments in the `ggplot2` geoms.

Usage

# S3 method for bcmeta
plot(
  x,
  plot.type = "predictive_with_bias",
  n.samples = NULL,
  x.lim = NULL,
  y.lim = NULL,
  x.lab = expression(theta^{
     new
 }),
  y.lab = "Posterior Predictive Distribution",
  title.plot = "Bias-Corrected Meta-Analysis",
  show.histogram = TRUE,
  show.rug = TRUE,
  show.legend.lines = FALSE,
  binwidth = 0.08,
  adjust = 1,
  density.color = "blue",
  density.lty = "solid",
  density.lwd = 1,
  density.alpha = 0.2,
  hist.color = "black",
  hist.fill = "grey95",
  rug.color = "green",
  rug.alpha = 0.5,
  predictive.color = "blue",
  mu.color = "black",
  bias.color = "red",
  ...
)

Arguments

x

The object generated by the bcmeta function.

plot.type

A character string specifying the type of plot: "predictive_with_bias" (default), "predictive", "tau_posterior".

n.samples

The number of posterior samples to plot.

x.lim

Numeric vector of length 2 specifying the x-axis limits.

y.lim

Numeric vector of length 2 specifying the y-axis limits.

x.lab

Text with the label of the x-axis. Defaults to \(\theta^{new}\).

y.lab

Text with the label of the y-axis. Defaults to "Posterior Predictive Distribution".

title.plot

Text for setting a title in the plot. Defaults to "Bias-Corrected Meta-Analysis".

show.histogram

A logical value indicating whether to show the histogram.

show.rug

A logical value indicating whether to show the rug plot.

show.legend.lines

A logical value indicating whether to show the legend for the density curves in the "predictive_with_bias" plot.

binwidth

A numeric value specifying the bin width for the histogram.

adjust

A numeric value to adjust the bandwidth of the density curves.

density.color

A character value for the density curve color (used for non-comparison plots).

density.lty

A character value for the density curve line type.

density.lwd

A numeric value for the density curve line width.

density.alpha

A numeric value between 0 and 1 for the density curve transparency.

hist.color

A character value for the histogram border color.

hist.fill

A character value for the histogram fill color.

rug.color

A character value for the rug plot color.

rug.alpha

A numeric value between 0 and 1 for the rug plot transparency.

predictive.color

A character value specifying the color of the posterior predictive density curve in "predictive_with_bias".

mu.color

A character value specifying the color of the posterior mean density curve in "predictive_with_bias".

bias.color

A character value specifying the color of the bias-inflated mean density curve in "predictive_with_bias".

...

...