-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmi.Rmd
More file actions
40 lines (33 loc) · 772 Bytes
/
mi.Rmd
File metadata and controls
40 lines (33 loc) · 772 Bytes
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
---
title: "``brms::mi``"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(brms)
```
## ``mi`` : Description
Predictors with Missing values in brms Models
#### Usage
<pre><code>
mi(x)
</code></pre>
#### Arguments
* ``x``: The variable containing missings.
### Examples
```{r}
data("nhanes", package = "mice")
bform <- bf(bmi | mi() ~ age * mi(chl)) +
bf(chl | mi() ~ age) + set_rescor(FALSE)
```
```{r}
fit <- brm(bform, data = nhanes)
summary(fit)
```
```{r}
plot(marginal_effects(fit, resp = "bmi"), ask = FALSE)
LOO(fit, newdata = na.omit(fit$data))
```
#### Details
For detailed documentation see help(brmsformula).
This function is almost solely useful when called in formulas passed to the brms package.