-
Notifications
You must be signed in to change notification settings - Fork 0
/
mvbrmsformula.Rmd
48 lines (31 loc) · 1.38 KB
/
mvbrmsformula.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
---
title: "``mvbrmsformula`` "
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(brms)
```
Set up a multivariate model formula for use in brms
#### Description
Set up a multivariate model formula for use in the brms package allowing to define (potentially non-linear) additive multilevel models for all parameters of the assumed response distributions.
#### Usage
<pre><code>
mvbrmsformula(..., flist = NULL, rescor = NULL)
</code></pre>
#### Arguments
* ``...``: Objects of class formula or brmsformula, each specifying a univariate model. See brmsformula for details on how to specify univariate models.
* ``flist``: Optional list of formulas, which are treated in the same way as formulas passed via the ``...`` argument.
* ``rescor``: Logical; Indicates if residual correlation between the response variables should be modeled. Currently, this is only possible in multivariate gaussian and student models. If NULL (the default), rescor is internally set to TRUE when possible.
#### Examples
```{r}
bf1 <- bf(y1 ~ x + (1|g))
bf2 <- bf(y2 ~ s(z))
mvbf(bf1, bf2)
```
#### Details
See vignette("brms_multivariate") for a case study.
#### Value
An object of class mvbrmsformula, which is essentially a list containing all model formulas as well as some additional information for multivariate models.
#### See Also
brmsformula, brmsformula-helpers