randomeffects {bmscstan}R Documentation

Random Effects specification on Bayesian Multilevel Single Case models using 'Stan'


The BMSC function allows the flexibility of multilevel (generalised) linear models on single case analysis.

In particular, it is possible to specify the population-level (a.k.a. mixed effects) and the group-level (a.k.a. random effects) coefficients.

The specification of the population- and group-level effects can be done using the well-known lme4 notation with specific limitations:


lmer formulation BMSC availability
(1 | grouping_factor) Yes
(1 + slope | grouping_factor) Yes
(0 + slope | grouping_factor) No
(1 | grouping_factor1 : grouping_factor2) Yes[^1]
(1 | grouping_factor1 / grouping_factor2) Yes[^2]

[^1]: The BMSC function dose not allow the use of the interaction symbol ":", but this problem is easily solved by creating a new variable within your dataframe given by the interaction of the two factors.

[^2]: The (1 | grouping_factor1 / grouping_factor2) syntax is the equivalent of the explicit version (1 \| grouping_factor1:grouping_factor2) + (1 | grouping_factor1).

Therefore, you need to create a new grouping factor representing the interaction between grouping_factor1 and grouping_factor2, and use this in the explicit version (1 | grouping_factor_interaction) + (1 | grouping_factor1).

[Package bmscstan version 1.1.0 Index]