comparedens {jagshelper} | R Documentation |
Compare Density
Description
Side-by-side kernel density plots for all parameters (or a specified subset) from two jagsUI
output objects or data.frame
s. The intent of this function is easy comparison of inferences from two comparable models.
Kernel densities are plotted vertically, either left- or right-facing. Parameters with the same name are plotted facing one another.
Usage
comparedens(
x1,
x2,
p = NULL,
minCI = 0.99,
ylim = NULL,
legendnames = NULL,
legendpos = "topleft",
col = c(4, 2),
...
)
Arguments
x1 |
Output object returned from |
x2 |
Second output object returned from |
p |
Optional vector of parameters to subset. All parameters with names matching the beginning of the
string supplied will be returned. If the default ( |
minCI |
Minimum CI width for plotting. This is intended as a method for excluding far-outlying MCMC samples when determining the appropriate y-axis limits for plotting. Defaults to 99%. |
ylim |
Y-axis limits for plotting. If the default ( |
legendnames |
Names for optional legend. If the default |
legendpos |
Position for optional legend. Defaults to |
col |
Colors for kernel density plots. Defaults to colors |
... |
additional plotting arguments |
Value
NULL
Author(s)
Matt Tyers
See Also
Examples
## This is the same output object twice, but shows functionality.
comparedens(x1=asdf_jags_out, x2=asdf_jags_out, p=c("a","b","sig"),
legendnames=c("Model 1", "Model 2"))