Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

boxplot.true

Compare Boxplots to True Values


Description

Plots side-by-side boxplots of the columns of the matrix x. Each boxplot can have its own reference line (truth) and standard error lines se.truth, if desired. This function was originally written to display MCMC output, where the reference lines were true values used to test an MCMC simulation.

Usage

BoxplotTrue(x, truth = NULL, vnames = NULL, center = FALSE,
            se.truth = NULL, color = "white", truth.color = "black",
            ylim = NULL, ...)

Arguments

x

The matrix whose columns are to be plotted.

truth

(optional) A vector of reference values with length equal to ncol(x).

vnames

(optional) character vector giving the column names of x.

center

(optional) logical. If truth is supplied then center=TRUE will center each column of x around truth to show the variation around the reference line.

se.truth

(optional) numeric vector of length ncol(x). If truth is supplied then additional reference lines will be drawn at truth +/- 2*se.truth.

color

(optional) vector of colors for each boxplot.

truth.color

A color (or vector of colors) to use for the segments representing true values.

ylim

Limits for the vertical axis. If NULL then the axis will be scaled to fit x, truth, and truth + c(2, -2) * se.truth

...

additional arguments to boxplot.

Value

called for its side effect

Author(s)

Steven L. Scott

See Also

Examples

x <- t(matrix(rnorm(5000, 1:5, 1:5), nrow=5))
BoxplotTrue(x, truth=1:5, se.truth=1:5, col=rainbow(5), vnames =
  c("EJ", "TK", "JT", "OtherEJ", "TJ") )

Boom

Bayesian Object Oriented Modeling

v0.9.7
LGPL-2.1 | file LICENSE
Authors
Steven L. Scott is the sole author and creator of the BOOM project. Some code in the BOOM libraries has been modified from other open source projects. These include Cephes (obtained from Netlib, written by Stephen L. Moshier), NEWUOA (M.J.D Powell, obtained from Powell's web site), and a modified version of the R math libraries (R core development team). Original copyright notices have been maintained in all source files. In these cases, copyright claimed by Steven L. Scott is limited to modifications made to the original code. Google claims copyright for code written while Steven L. Scott was employed at Google from 2008 - 2018, but BOOM is not an officially supported Google project.
Initial release
2021-02-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.