Skip to content

Quick start

The code examples below introduce different modeling frameworks, or–if you know what you’re looking for–get you going right away with a specific model type.

Logistic regression

Have a look at this most simple logistic regression!

library(brms)
n <- 30
x <- rnorm(n, mean = 0, sd = 1)
p <- ifelse(x > 1, 0.2, 0.8)
y <- sapply(p, function(p) sample(c(0, 1), 1, prob = c(1 - p, p)))
data <- data.frame(x = x, y = y)
fit <- brm(y ~ x, family = bernoulli(link = "logit"), data = data)
fit

Multilevel models Work In Progress

Hierarchical modeling comes natural in the Bayesian framework. Simply stack distributions!

Let’s first have a look at the simplest case: a random intercept-only model.

#