plotPosterior | R Documentation |
This function plots, univariately, the posterior densities obtained in Bayesian analyses.
plotPosterior(
results,
parameter = 1,
num.points = 1000,
plot.rope = TRUE,
plot.samples = TRUE,
alpha = NULL,
...
)
results |
A list containing, at least three elements, one named |
parameter |
Either a string or a number indicating, in case the posterior is approximated, the parameter to be ploted (i.e., the name or the index of a column in the sample matrix) |
num.points |
Number of points used to plot the functions |
plot.rope |
A logical value indicating whether the rope has to be plotted or not. Note that not for all parameter the rope makes sense |
plot.samples |
A logical value. If true, the samples are plotted (only when the posterior is approximate) |
alpha |
Numeric value for the transparency of the points, only applicable if |
... |
Additional parameters to the Rgraphviz function. This is mainly to change the layout of the graph |
Note that if the methods are exact (not simulated), the true density can be plotted but, for those cases where the posterior is approximated through sampling, the function will plot a kernel density estimation of the posterior and, thus, the probabilities computed by other functions are not directly the areas under the densities.
An object of class ggplot with the plot
x <- rnorm(25, 1, 2)
y <- rnorm(25, 1.1, 2)
results <- bCorrelatedTtest(x=x, y=y, rho=0, rope=c(-0.05, 0.05))
plotPosterior(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.