plotbayestwin {BayesTwin} | R Documentation |
plotbayestwin
returns either a density or trace plot for the target parameter.
plotbayestwin(sample, t = "density", main, xlab, ylab, legend = TRUE, lines = TRUE, ...)
sample |
A vector representing draws from the posterior distribution of the parameter of interest, as produced by the main function |
t |
Type of plot that is produced, either "density" to get a histogram of the posterior distribution or "trace"to get a trace plot. Default value is "density" |
main |
An overall title for the plot |
xlab |
A title for the x axis |
ylab |
A title for the y axis |
legend |
Indicating if a legend should be added. Default value is TRUE. |
lines |
Indicating if lines for mean, median and lower and upper limit of the 95% HPD should be added. Default value is TRUE |
... |
Further arguments for the generic S3 method histogram (for the density plot) or plot (for the trace plot) method |
Creates either a density or trace plot for the target parameter.
The function expects as input a vector representing draws from the posterior distributions of the parameter of interest, as produced by the main function IRT_twin
of this package.
Inga Schwabe
data(results)
##Plot posterior distribution of var(A)
plotbayestwin(results$samples_var_a)