plotbayestwin
returns either a density or trace plot for the target parameter.
plotbayestwin(sample, t = "density", main, xlab, ylab, legend = TRUE, lines = TRUE, ...)
A vector representing draws from the posterior distribution of the parameter of interest, as produced by the main function IRT_twin
of this package
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"
An overall title for the plot
A title for the x axis
A title for the y axis
Indicating if a legend should be added. Default value is TRUE.
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.
data(results)
##Plot posterior distribution of var(A)
plotbayestwin(results$samples_var_a)
Run the code above in your browser using DataLab