Learn R Programming

wiqid (version 0.3.3)

plot.Bwiqid: Plot method for objects of class 'Bwiqid'

Description

Method to display a plot showing the posterior probability distribution of one of the parameters of interest.

Usage

# S3 method for Bwiqid
plot(x, which=NULL, credMass=0.95,
           ROPE=NULL, compVal=NULL, showCurve=FALSE,
           showMode=FALSE, shadeHDI=NULL,  ...)

Value

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

Arguments

x

an object of class Bwiqid.

which

character: indicates which parameter to plot. If NULL and x has a defaultPlot attribute, that parameter is plotted; otherwise the parameter in column 1 is plotted.

credMass

the probability mass to include in credible intervals; NULL suppresses plotting.

ROPE

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

compVal

a value for comparison with the parameter.

showCurve

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

showMode

logical: if TRUE, the mode of the posterior density will be shown instead of the mean.

shadeHDI

specifies a colour to shade the area under the curve corresponding to the HDI; NULL for no shading. Ignored if showCurve = FALSE. Usecolours() to see a list of possible colours.

...

other graphical parameters.

Author

Mike Meredith, adapted from code by John Kruschke.

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 a parameter precisely zero (or has any other point value) is zero. More interesting is the probability that the difference from zero 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.

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

postPlot.

Examples

Run this code
# See examples in dippers.

Run the code above in your browser using DataLab