caterpillar | R Documentation |
Caterpillar plot of the posterior densities of a vector of parameter nodes, in which the sequential order of nodes might not be important, such as vector of random effects.
This produces a set of overlayed interval bars (default values are 50 percent and 95 percent), with overlayed median markings, for each of a vector of parameter nodes.
caterpillar(
df,
p = NULL,
x = NA,
row = NULL,
column = NULL,
median = TRUE,
mean = FALSE,
ci = c(0.5, 0.95),
lwd = 1,
col = 4,
add = FALSE,
xlab = "",
ylab = "",
main = NULL,
ylim = NULL,
xax = NA,
transform = c("none", "exp", "expit"),
medlwd = lwd,
medwd = 1,
...
)
df |
Output object returned from |
p |
Parameter name, if input to |
x |
Vector of X-coordinates for plotting. |
row |
Row to subset, in the case of a 2-d matrix of parameter nodes in-model. |
column |
Column to subset, in the case of a 2-d matrix of parameter nodes in-model. |
median |
Whether to include medians |
mean |
Whether to include means |
ci |
Vector of intervals to overlay. Defaults to 50 percent and 95 percent. |
lwd |
Base line width for plotting. Defaults to 1. |
col |
Color for plotting |
add |
Whether to add to existing plot |
xlab |
X-axis label |
ylab |
Y-axis label |
main |
Plot title. If the default ( |
ylim |
Y-axis limits. If the default ( |
xax |
Vector of possible x-axis tick labels. Defaults to the |
transform |
Should the y-axis be (back)transformed? Options are |
medlwd |
Line width of median line |
medwd |
Relative width of median line. Defaults to 1, perhaps smaller numbers will look better? |
... |
additional plotting arguments |
NULL
Matt Tyers
envelope, crossplot
## usage with input data.frame
a <- jags_df(asdf_jags_out, p="a")
caterpillar(a)
caterpillar(a, ci=seq(.1,.9,by=.1))
caterpillar(a, lwd=2)
caterpillar(a, xax=c("effect 1", "effect 2", "effect 3"))
## usage with input as jagsUI object
caterpillar(asdf_jags_out, p="a")
caterpillar(SS_out, p="rate")
## usage with a 2-d parameter matrix
caterpillar(SS_out, p="cycle_s", column=1)
caterpillar(SS_out, p="cycle_s", column=2)
## usage with an exponential transformation
caterpillar(SS_out, p="trend", transform="exp", ylab="exp transform")
caterpillar(SS_out, p="trend", transform="exp", ylab="exp transform", log="y")
caterpillar(SS_out, p="trend", transform="expit", ylab="expit (inv logit) transform")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.