brms_miss_1 | R Documentation |
brms_miss_1
brms_miss_1
An object of class brmsfit
of length 23.
## Not run:
dat <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/carData/TitanicSurvival.csv")
dat$survived <- ifelse(dat$survived == "yes", 1, 0)
dat$woman <- ifelse(dat$sex == "female", 1, 0) |> as.factor()
sum(is.na(dat$age)) # <-- 263 missing values
brm(
bf(
survived ~ woman * mi(age) + passengerClass,
family = bernoulli(link = "logit")
) +
bf(age | mi() ~ passengerClass + woman) +
set_rescor(FALSE),
data = dat,
backend = "cmdstanr",
cores = 4
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.