I am trying to fit a Bayesian multilevel model in R and have several questions. I found two packages (brms and rstanarm) and am able to perform the analysis with both of them, so the technical part is not the problem. But:

  • How do I decide for one of the two packages? Do they calculate differently or are they basically the same? Is there a way to tell if one the two should be preferred? If so, how?
  • I did not specify any priors yet because I didn’t want to do anything wrong. However, I expect a positive effect because the treatment I examine has shown positive effects in numerous studies before (though with slightly different material, hence I cannot be completely sure either, especially about the magnitude of the effect). How is the best way to specify priors in a way that translates to “I’m not so sure about the magnitude but I expect a positive effect”?
  • Is it common to just interpret the single parameters of my final model (e.g., median and MPE) or should I include the Bayes Factor for my central effect as well?

I never used Bayesian statistics in my work before, but I see the benefits and would like to get a better understanding. If anyone has any advice, general of specifically regarding my questions above, it would be greatly appreciated.

Here is what I mainly used to work with the brms package: https://cran.r-project.org/web/packages/brms/vignettes/brms_multilevel.pdf

And here is the tutorial I used for rstanarm: https://cran.r-project.org/web/packages/psycho/vignettes/bayesian.html#mixed-models


I just wanted to give an update for anyone interested:

  • I understood that both rstanarm and brms use Stan for the computation of the Bayesian models. Therefore, I assumed that the decision between these two packages is not crucial and I opted for brms, because I found it more intuitive and found enough resources to conduct and interpret my analyses. A comparison between the packages is also included in the source I listed above (https://cran.r-project.org/web/packages/brms/vignettes/brms_multilevel.pdf).

  • Because there is only little research on the specific effect I investigated, I decided to discard the specification of priors and sticked to the default prior (an improper flat prior over the reals, see https://www.jstatsoft.org/article/view/v080i01) for my parameters.

  • I decided to interpret the mean of the posterior distribution and the respective 95% credible interval of all included parameters (including control variables). For my central effect (the one referring to my hypothesis) I also computed the evidence ratio, which can be interpreted as a one-sided Bayes factor (see https://github.com/paul-buerkner/brms/issues/311).

I will now mark my question as answered. However, if anyone with more expertise detects a mistake or is willing to answer my original questions I would still be grateful for hints and corrections.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.