paul-buerkner/brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan

What it solves

This package provides a user-friendly way to perform complex Bayesian statistical modeling in R. It allows researchers to fit advanced models—such as multilevel, non-linear, and multivariate regressions—without needing to write complex code from scratch, while still leveraging the powerful, high-performance Stan engine for full Bayesian inference.

How it works

It acts as a high-level interface that translates familiar R formula syntax (similar to the popular lme4 package) into Stan code. It handles the underlying C++ compilation automatically, allowing you to define custom response distributions, incorporate smooth terms, handle missing data, and specify flexible prior distributions. Once a model is fitted, it provides built-in tools for visual diagnostics, cross-validation, and posterior predictive checks to evaluate model performance.

Who it’s for

It is designed for statisticians, data scientists, and researchers who need to perform rigorous Bayesian analysis but prefer a familiar, R-based workflow. It is particularly useful for those working with multilevel (hierarchical) data or complex models that require more flexibility than standard pre-compiled packages offer.

Highlights

  • Supports a vast range of model types including linear, count, survival, ordinal, and zero-inflated models.
  • Uses intuitive formula syntax that makes advanced Bayesian modeling accessible.
  • Offers flexible prior specifications to incorporate domain knowledge or beliefs.
  • Includes robust post-processing tools for model comparison, such as leave-one-out (LOO) cross-validation and Bayes factors.
  • Provides methods for missing value imputation and non-linear or smooth term modeling.

Related

  • Project
  • Project
  • Project
  • Project
  • Project