Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 1013 Bytes

README.md

File metadata and controls

13 lines (9 loc) · 1013 Bytes

Fit GLMM with R package brms

I regularly give a course on Bayesian statistics with R for non-specialists. To illustrate the course, we analyse data with generalized linear, often mixed, models or GLMMs.

So far, I've been using Jags to fit these models. This requires some programming skills, like e.g. coding a loop, to be able to write down the model likelihood. Although students learn a lot from going through that process, it can be daunting.

This year, I thought I'd show them the R package brms developed by Paul-Christian Bürkner. In brief, brms allows fitting GLMMs (but not only) in a lme4-like syntax within the Bayesian framework and MCMC methods with Stan.

In this repo I go through the course examples and fit the models with glm() and (g)lmer() functions, Jags and brms.