-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.brmsfit.Rmd
54 lines (43 loc) · 1.92 KB
/
plot.brmsfit.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: "``brms::plot.brmsfit``"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(brms)
```
## plot.brmsfit Trace and Density Plots for MCMC Samples
#### Description
Trace and Density Plots for MCMC Samples
#### Usage
<pre><code>
## S3 method for class 'brmsfit'
plot(x, pars = NA, combo = c("dens", "trace"),
N = 5, exact_match = FALSE, theme = NULL, plot = TRUE,
ask = TRUE, newpage = TRUE, ...)
</code></pre>
#### Arguments
* ``x``: An object of class brmsfit.
* ``pars``: Names of the parameters to plot, as given by a character vector or a regular expression. By default, all parameters except for group-level and smooth effects are plotted.
* ``combo``: A character vector with at least two elements. Each element of combo corresponds to a column in the resulting graphic and should be the name of one of the available MCMC functions (omitting the ``mcmc_ prefix``).
* ``N``: The number of parameters plotted per page.
* ``exact_match``: Indicates whether parameter names should be matched exactly or treated as regular expression. Default is FALSE.
* ``theme``: A theme object modifying the appearance of the plots. For some basic themesmsee ggtheme and theme_default.
* ``plot``: logical; indicates if plots should be plotted directly in the active graphic device. Defaults to TRUE.
* ``ask``: logical; indicates if the user is prompted before a new page is plotted. Only used if plot is TRUE.
* ``newpage``: logical; indicates if the first set of plots should be plotted to a new page. Only used if plot is TRUE.
* ``... ``: Further arguments passed to mcmc_combo.
#### Examples
```{r}
fit <- brm(count ~ zAge + zBase * Trt + (1|patient) + (1|visit),
data = epilepsy, family = "poisson")
plot(fit)
```
```{r}
## plot population-level effects only
plot(fit, pars = "^b_")
```
#### Value
An invisible list of gtable objects.
#### Author(s)
Paul-Christian Buerkner <[email protected]>