No access
Tutorial
21 May 2019

An Introduction to Bayesian Multilevel Models Using brms: A Case Study of Gender Effects on Vowel Variability in Standard Indonesian

Publication: Journal of Speech, Language, and Hearing Research
Volume 62, Number 5
Pages 1225-1242

Abstract

Purpose

Bayesian multilevel models are increasingly used to overcome the limitations of frequentist approaches in the analysis of complex structured data. This tutorial introduces Bayesian multilevel modeling for the specific analysis of speech data, using the brms package developed in R.

Method

In this tutorial, we provide a practical introduction to Bayesian multilevel modeling by reanalyzing a phonetic data set containing formant (F1 and F2) values for 5 vowels of standard Indonesian (ISO 639-3:ind), as spoken by 8 speakers (4 females and 4 males), with several repetitions of each vowel.

Results

We first give an introductory overview of the Bayesian framework and multilevel modeling. We then show how Bayesian multilevel models can be fitted using the probabilistic programming language Stan and the R package brms, which provides an intuitive formula syntax.

Conclusions

Through this tutorial, we demonstrate some of the advantages of the Bayesian framework for statistical modeling and provide a detailed case study, with complete source code for full reproducibility of the analyses (https://osf.io/dpzcb/).

Supplemental Material

Get full access to this article

View all available purchase options and get full access to this article.

References

Akaike, H. (1974). A new look at the statistical model identification. IEEE Transactions on Automatic Control, 19(6), 716–723.
Aust, F., & Barth, M. (2017). papaja: Create APA manuscripts with R Markdown. Retrieved from https://github.com/crsh/papaja
Bakan, D. (1966). The test of significance in psychological research. Psychological Bulletin, 66(6), 423–437.
Barr, D. J., Levy, R., Scheepers, C., & Tily, H. J. (2013). Random effects structure for confirmatory hypothesis testing: Keep it maximal. Journal of Memory and Language, 68(3), 255–278.
Bates, D., Kliegl, R., Vasishth, S., & Baayen, R. H. (2015). Parsimonious mixed models. Retrieved from https://arxiv.org/pdf/1506.04967.pdf
Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1), 1–48.
Bürkner, P.-C. (2017a). Advanced bayesian multilevel modeling with the R package brms. Retrieved from https://arxiv.org/pdf/1705.11123
Bürkner, P.-C. (2017b). brms: An R package for bayesian multilevel models using Stan. Journal of Statistical Software, 80(1), 1–28.
Bürkner, P.-C., Williams, D. R., Simmons, T. C., & Woolley, J. D. (2017). Intranasal oxytocin may improve high-level social cognition in schizophrenia, but not social cognition or neurocognition in general: A multilevel Bayesian meta-analysis. Schizophrenia Bulletin, 43(6), 1291–1303.
Cumming, G. (2012). Understanding the new statistics: Effect sizes, confidence intervals, and meta-analysis. New York, NY: Routledge.
Cumming, G. (2014). The new statistics: Why and how. Psychological Science, 25(1), 7–29.
Dienes, Z. (2011). Bayesian versus orthodox statistics: Which side are you on. Perspectives on Psychological Science, 6(3), 274–290.
Eager, C., & Roy, J. (2017). Mixed effects models are sometimes terrible. Retrieved from https://arxiv.org/pdf/1701.04858.pdf
Garnier, S. (2017). Viridis: Default color maps from ‘matplotlib.’. Retrieved from https://CRAN.R-project.org/package=viridis
Gelman, A. (2005). Analysis of variance—Why it is more important than ever. The Annals of Statistics, 33(1), 1–53.
Gelman, A. (2006). Prior distributions for variance parameter in hierarchical models. Bayesian Analysis, 1(3), 515–534.
Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis (3rd ed.). Boca Raton, FL: CRC Press.
Gelman, A., Goodrich, B., Gabry, J., & Ali, I. (2017). R-squared for Bayesian regression models. Retrieved from https://github.com/jgabry/bayes_R2/blob/master/bayes_R2.pdf
Gelman, A., & Hill, J. (2007). Data analysis using regression and multilevel/hierarchical models. New York, NY: Cambridge University Press.
Gelman, A., Hill, J., & Yajima, M. (2012). Why we (usually) don't have to worry about multiple comparisons. Journal of Research on Educational Effectiveness, 5, 189–211.
Gelman, A., Hwang, J., & Vehtari, A. (2014). Understanding predictive information criteria for Bayesian models. Statistics and Computing, 24(6), 997–1016.
Gelman, A., & Pardoe, I. (2006). Bayesian measures of explained variance and pooling in multilevel (hierarchical) models. Technometrics, 48(2), 241–251.
Gelman, A., & Rubin, D. B. (1992). Inference from iterative simuation using multiple sequences. Statistical Science, 7(4), 457–472.
Gigerenzer, G., Krauss, S., & Vitouch, O. (2004). The null ritual: What you always wanted to know about significance testing but were afraid to ask. In Kaplan, D. (Ed.), The Sage handbook of methodology for the social sciences (pp. 391–408). Thousand Oaks, CA: Sage.
Hedges, L. V. (2007). Effect sizes in cluster-randomized designs. Journal of Educational and Behavioral Statistics, 32(4), 341–370.
Hoekstra, R., Morey, R. D., Rouder, J. N., & Wagenmakers, E.-J. (2014). Robust misinterpretation of confidence intervals. Psychonomic Bulletin & Review, 21(5), 1157–1164.
Janssen, D. P. (2012). Twice random, once mixed: Applying mixed models to simultaneously analyze random effects of language and participants. Behavior Research Methods, 44(1), 232–247.
Judd, C. M., Westfall, J., & Kenny, D. A. (2017). Experiments with more than one random factor: Designs, analytic models, and statistical power. Annual Review of Psychology, 68, 601–625.
Kline, R. (2004). What's wrong with statistical tests—And where we go from here. In Kline, R. B. (Ed.), Beyond significance testing: Reforming data analysis methods in behavioral research (pp. 61–91). Washington, DC: American Psychological Association
Kruschke, J. K. (2015). Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan (2nd ed.). Burlington, MA: Academic Press/Elsevier.
Kruschke, J. K., & Liddell, T. M. (2018a). Bayesian data analysis for newcomers. Psychonomic Bulletin & Review, 25, 155–177.
Kruschke, J. K., & Liddell, T. M. (2018b). The Bayesian new statistics: Hypothesis testing, estimation, meta-analysis, and power analysis from a Bayesian perspective. Psychonomic Bulletin & Review, 25, 178–206.
Kruschke, J. K., & Meredith, M. (2018). BEST: Bayesian estimation supersedes the t-test. Retrieved from https://CRAN.R-project.org/package=BEST
Lambdin, C. (2012). Significance tests as sorcery: Science is empirical—Significance tests are not. Theory & Psychology, 22(1), 67–90.
Lewandowski, D., Kurowicka, D., & Joe, H. (2009). Generating random correlation matrices based on vines and extended onion method. Journal of Multivariate Analysis, 100(9), 1989–2001.
Marsman, M., Waldorp, L., Dablander, F., & Wagenmakers, E.-J. (2017). Bayesian estimation of explained variance in ANOVA designs. Retrieved from http://maartenmarsman.com/wp-content/uploads/2017/04/MarsmanEtAl_R2.pdf
McCloy, D. R. (2014). Phonetic effects of morphological structure in Indonesian vowel reduction. Proceedings of Meetings on Acoustics, 12, 060009.
McCloy, D. R. (2016). phonR: Tools for phoneticians and phonologists [Computer software] . Available from https://rdrr.io/cran/phonR/
McElreath, R. (2016). Statistical rethinking. Boca Raton, FL: Chapman and Hall/CRC Press.
Morey, R. D., Hoekstra, R., Rouder, J. N., Lee, M. D., & Wagenmakers, E.-J. (2015). The fallacy of placing confidence in confidence intervals. Psychonomic Bulletin & Review, 23, 103–123.
Murdoch, D., & Chow, E. D. (2013). ellipse: Functions for drawing ellipses and ellipse-like confidence regions. Retrieved from https://CRAN.R-project.org/package=ellipse
Nicenboim, B., & Vasishth, S. (2016). Statistical methods for linguistic research: Foundational ideas—Part II. Language and Linguistics Compass, 10(11), 591–613.
Polson, N. G., & Scott, J. G. (2012). On the half-Cauchy prior for a global scale parameter. Bayesian Analysis, 7(4), 887–902.
R Core Team. (2018). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from https://www.R-project.org/
Robinson, D. (2017). broom: Convert statistical analysis objects into tidy data frames. Retrieved from https://CRAN.R-project.org/package=broom
Scott, J. G., & Berger, J. O. (2010). Bayes and empirical-Bayes multiplicity adjustment in the variable-selection problem. The Annals of Statistics, 38(5), 2587–2619.
Sorensen, T., Hohenstein, S., & Vasishth, S. (2016). Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists. The Quantitative Methods for Psychology, 12(3), 175–200.
Stan Development Team. (2016). Stan modeling language users guide and reference manual. Retrieved from http://mc-stan.org
Trafimow, D., Amrhein, V., Areshenkoff, C. N., Barrera-Causil, C. J., Beh, E. J., Bilgiç, Y. K., … Marmolejo-Ramos, F. (2018). Manipulating the alpha level cannot cure significance testing. Frontiers in Psychology, 9, 699.
Vehtari, A., Gelman, A., & Gabry, J. (2017). Practical Bayesian model evaluation using leave-one-out cross-validation and WAIC. Statistics and Computing, 27(5), 1413–1432.
Watanabe, S. (2010). Asymptotic equivalence of Bayes cross validation and widely applicable information criterion in singular learning theory. Journal of Machine Learning Research, 11, 3571–3594.
Watt, D., & Fabricius, A. (2002). Evaluation of a technique for improving the mapping of multiple speakers' vowel spaces in the F1∼F2 plane. Leeds Working Papers in Linguistics and Phonetics, 9(9), 159–173.
Wickham, H. (2009). ggplot2: Elegant graphics for data analysis. New York, NY: Springer-Verlag. Retrieved from http://ggplot2.org
Wickham, H. (2017). tidyverse: Easily install and load ‘tidyverse’ packages. Retrieved from https://CRAN.R-project.org/package=tidyverse
Wilke, C. O. (2017). ggridges: Ridgeline plots in ‘ggplot2.’ Retrieved from https://CRAN.R-project.org/package=ggridges
Williams, D. R., & Bürkner, P.-C. (2017). Psychoneuroendocrinology effects of intranasal oxytocin on symptoms of schizophrenia: A multivariate Bayesian meta-analysis. Psychoneuroendocrinology, 75, 141–151.
Xie, Y. (2015). Dynamic documents with R and knitr (2nd ed.). Boca Raton, FL: Chapman and Hall/CRC Press. Retrieved from https://yihui.name/knitr/

Information & Authors

Information

Published In

Journal of Speech, Language, and Hearing Research
Volume 62Number 5May 2019
Pages: 1225-1242
PubMed: 31082309

History

  • Received: Jan 11, 2018
  • Revised: Mar 26, 2018
  • Accepted: Aug 15, 2018
  • Published online: May 10, 2019
  • Published in issue: May 21, 2019

Permissions

Request permissions for this article.

Authors

Affiliations

Ladislas Nalborczyk
Univ. Grenoble Alpes, CNRS, LPNC, 38000 Grenoble, France
Department of Experimental Clinical and Health Psychology, Ghent University, Belgium
Cédric Batailler
Univ. Grenoble Alpes, Univ. Savoie Mont Blanc, LIP/PC2S, France
Hélène Lœvenbruck
Univ. Grenoble Alpes, CNRS, LPNC, 38000 Grenoble, France
Anne Vilain
Institut Universitaire de France, Paris
Univ. Grenoble Alpes, CNRS, Grenoble INP, GIPSA-lab, 38000, Grenoble, France
Paul-Christian Bürkner
Department of Psychology, University of Münster, Germany

Notes

Disclosure: The authors have declared that no competing interests existed at the time of publication.
Paul-Christian Bürkner is now with the Department of Computer Science, Aalto University, Espoo, Finland.
Correspondence to Ladislas Nalborczyk: [email protected]
Editor-in-Chief: Julie Liss
Editor: Bharath Chandrasekaran

Metrics & Citations

Metrics

Article Metrics
View all metrics



Citations

If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

For more information or tips please see 'Downloading to a citation manager' in the Help menu.

Citing Literature

  • Advancements of phonetics in the 21st century: Quantitative data analysis, Journal of Phonetics, 10.1016/j.wocn.2025.101415, 111, (101415), (2025).
  • A cross-cultural examination of bi-directional mentalising in autistic and non-autistic adults, Molecular Autism, 10.1186/s13229-025-00659-z, 16, 1, (2025).
  • White matter microstructural associations with pain experiences in a large community sample of youth, Pain, 10.1097/j.pain.0000000000003580, (2025).
  • Barrier features, fish traits, and river flows drive fragmentation of freshwater fish, Ecological Monographs, 10.1002/ecm.70014, 95, 2, (2025).
  • The status of /f/ in Mayan-accented Spanish, Studies in Hispanic and Lusophone Linguistics, 10.1515/shll-2025-2001, 18, 1, (1-35), (2025).
  • The impact of neonatal antibiotic exposure on the development of childhood food allergies, European Journal of Pediatrics, 10.1007/s00431-025-06136-2, 184, 5, (2025).
  • Phenotypic response to food availability in sea urchin larvae and impact of light during development and growth, Frontiers in Ecology and Evolution, 10.3389/fevo.2025.1548208, 13, (2025).
  • Revisiting the electrophysiological correlates of valence and expectancy in reward processing – A multi-lab replication, Cortex, 10.1016/j.cortex.2024.12.017, 184, (150-171), (2025).
  • Applying multilevel regression to ordered response variables: an analysis of trust in the prosecutor's office, Korean Journal of Applied Statistics, 10.5351/KJAS.2025.38.1.029, 38, 1, (29-44), (2025).
  • State of knowledge on the effectiveness of management interventions to restore degraded eucalypt woodlands, Restoration Ecology, 10.1111/rec.70004, 33, 4, (2025).
  • See more

View Options

Sign In Options

ASHA member? If so, log in with your ASHA website credentials for full access.

Member Login

View options

PDF

View PDF

Full Text

View Full Text

Figures

Tables

Media

Share

Share

Copy the content Link

Share