Learn R Programming

jarbes (version 2.4.2)

plot.bcmixmeta: Generic plot function for bcmixmeta object.

Description

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

Usage

# S3 method for bcmixmeta
plot(
  x,
  plot.type = "predictive",
  n.samples = NULL,
  x.lim = NULL,
  y.lim = NULL,
  x.lab = NULL,
  y.lab = "Posterior Predictive Distribution",
  title.plot = NULL,
  show.histogram = TRUE,
  show.rug = NULL,
  binwidth = 0.08,
  adjust = 1,
  density.color = "blue",
  hist.color = "black",
  hist.fill = "grey95",
  rug.color = "green",
  rug.alpha = 1,
  density.alpha = 0.2,
  density.lwd = 1,
  density.lty = 1,
  ...
)

Arguments

x

The object generated by the bcmixmeta function (the BC-BNP model output).

plot.type

A character string specifying the type of plot: - "predictive": Plots the posterior predictive distribution of a new study (unbiased density vs potentially biased histogram). - "mu_posterior": Plots the posterior of the overall mean (mu.theta). - "tau_posterior": Plots the posterior of the between-study standard deviation (sd.theta).

n.samples

The number of posterior samples to plot. If NULL, all samples are used.

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.

y.lab

Text with the label of the y-axis.

title.plot

Text for setting a title in the plot.

show.histogram

A logical value indicating whether to show the histogram.

show.rug

A logical value indicating whether to show the rug plot. Defaults to TRUE for predictive and mu plots, FALSE for tau.

binwidth

A numeric value specifying the bin width for the histogram.

adjust

A numeric value for the density bandwidth adjustment.

density.color

A character value for the density curve color.

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.

density.alpha

A numeric value for the density curve transparency.

density.lwd

A numeric value for the density curve line width.

density.lty

A numeric value for the density curve line type.

...

...