plot.BEST {BEST}R Documentation

A plot method for objects of class 'BEST'

Description

Displays a plot showing the posterior probability distribution of one of the parameters of interest, the difference in means by default.

Usage

## S3 method for class 'BEST'
plot(x, which = c("mean", "sd", "effect", "nu"), credMass = 0.95,
    ROPE = NULL, compVal = 0, showCurve = FALSE,
    mainColor="skyblue", dataColor="red", comparisonColor="darkgreen", 
    ROPEColor = "darkred", ...)

Arguments

x

an object of class BEST, as produced by the function BESTmcmc.

which

one of "mean", "sd", "effect" or "nu" or an abbreviation of one of these; indicates which estimate to plot. For a comparison of two groups, "mean" and "sd" display the difference in means or standard deviation.

credMass

the probability mass to include in credible intervals, or NULL to suppress plotting of the credible interval.

ROPE

a two element vector, such as c(-1, 1), specifying the limit of the ROPE on the estimate; see Details.

showCurve

logical: if TRUE, the posterior density will be represented by a kernel density function instead of a histogram.

compVal

a value for comparison with the (difference of) parameters.

mainColor

an optional color name such as "skyblue" or a RGB specification such as "#87CEEB" that controls the color of the bar charts and posterior prediction lines.

dataColor

an optional color name such as "red" or a RGB specification such as "#FF0000" that controls the color of the data histogram.

comparisonColor

a optional color name such as "darkgreen" or a RGB specification such as "#013220" that controls the color used to display the compVal.

ROPEColor

a optional color name such as "darkred" or a RGB specification such as "#8B0000" that controls the color used to display the ROPE.

...

other graphical parameters.

Details

The posterior distribution is shown as a histogram or density curve (if showCurve = TRUE), together with the Highest Density Interval. A ROPE and comparison value are also shown if appropriate.

The probability that the difference in means (or effect size, etc.) is precisely zero is zero. More interesting is the probability that the difference may be too small to matter. We can define a region of practical equivalence (ROPE) around zero, and obtain the posterior probability that the true value lies therein.

Value

Returns an object of class histogram invisibly. Used mainly for the side effect.

Author(s)

Mike Meredith, adapted from code by John Kruschke.

References

Kruschke, J. K. 2013. Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General 142(2):573-603. doi: 10.1037/a0029146

See Also

plotAll for a single plot showing all the parameters, summary for values of the corresponding summary statistics and pairs for a scatterplot matrix plot and correlation coefficients.

Examples

# See examples in BEST-package.

[Package BEST version 0.5.4 Index]