Learn R Programming

jarbes (version 2.4.2)

plot.dpmeta: Generic plot function for dpmeta 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 dpmeta
plot(
  x,
  n.samples = NULL,
  x.lim = NULL,
  y.lim = NULL,
  x.lab = expression(theta^{
     new
 }),
  y.lab = "Posterior Predictive Distribution",
  title.plot = "Dirichlet Process ",
  show.histogram = TRUE,
  show.rug = TRUE,
  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,
  ...
)

Arguments

x

The object generated by the dpmeta function.

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 "Treatment Effect".

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 "Dirichlet Process ".

show.histogram

A logical value indicating whether to show the histogram.

show.rug

A logical value indicating whether to show the rug plot.

binwidth

A numeric value specifying the bin width for the histogram. Defaults to 0.08.

adjust

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

density.color

A character value for the density curve color. Defaults to "blue".

density.lty

A character value for the density curve line type. Defaults to "solid".

density.lwd

A numeric value for the density curve line width. Defaults to 1.

density.alpha

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

hist.color

A character value for the histogram border color. Defaults to "black".

hist.fill

A character value for the histogram fill color. Defaults to "grey95".

rug.color

A character value for the rug plot color. Defaults to "green".

rug.alpha

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

...

...