Skip to contents


This package provides functions to model compositional data in a multilevel framework using full Bayesian inference. It integrates the principes of Compositional Data Analysis (CoDA) and Multilevel Modelling and supports both compositional data as an outcome and predictors in a wide range of generalized (non-)linear multivariate multilevel models.


To install the latest release version from CRAN, run


The current developmental version can be downloaded from github via

if (!requireNamespace("remotes")) {

Because multilevelcoda is built on brms, which is based on Stan, a C++ compiler is required. The program Rtools (available on comes with a C++ compiler for Windows. On Mac, Xcode is required. For further instructions on how to get the compilers running, see the prerequisites section on