Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
121 tokens/sec
GPT-4o
9 tokens/sec
Gemini 2.5 Pro Pro
47 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Bayesian linear mixed models using Stan: A tutorial for psychologists, linguists, and cognitive scientists (1506.06201v1)

Published 20 Jun 2015 in stat.ME

Abstract: With the arrival of the R packages nlme and lme4, linear mixed models (LMMs) have come to be widely used in experimentally-driven areas like psychology, linguistics, and cognitive science. This tutorial provides a practical introduction to fitting LMMs in a Bayesian framework using the probabilistic programming language Stan. We choose Stan (rather than WinBUGS or JAGS) because it provides an elegant and scalable framework for fitting models in most of the standard applications of LMMs. We ease the reader into fitting increasingly complex LMMs, first using a two-condition repeated measures self-paced reading study, followed by a more complex $2\times 2$ repeated measures factorial design that can be generalized to much more complex designs.

Citations (149)

Summary

A Tutorial on Bayesian Linear Mixed Models with Stan

The paper by Sorensen and Vasishth serves as a comprehensive tutorial aimed at researchers in psychology, linguistics, and cognitive science who are interested in fitting linear mixed models (LMMs) using the Bayesian framework. It leverages the probabilistic programming language, Stan, to model and analyze data from repeated measures designs, which are prevalent in these fields. The authors specifically choose Stan due to its scalability and flexibility in fitting complex models that are beyond the capabilities of other Bayesian modeling languages such as WinBUGS and JAGS.

The tutorial begins by introducing the concept of Bayesian linear mixed models, emphasizing the advantages they offer over traditional frequentist approaches, such as repeated measures ANOVA. These models allow researchers to account for multiple sources of variance within a single model without aggregating over subjects and items. Consequently, this facilitates the investigation of more nuanced effects and interactions in experimental data.

To elucidate the process of building Bayesian LMMs, the paper uses data from a self-paced reading paper as a running example, initially employing a simple two-condition design. The authors guide the reader through fitting increasingly complex models, starting with a fixed-effects model, moving to a varying intercepts model, and finally, a varying intercepts and slopes model. They meticulously detail the implementation of these models in Stan, providing code snippets and explanations of the statistical modeling concepts involved.

The tutorial further explores the interpretation and inference of Bayesian model outputs. The concept of credible intervals is introduced as a tool for making judgments about parameter estimates. Unlike frequentist confidence intervals, credible intervals express a range where the true parameter value is believed to reside with a certain probability, given the data and prior beliefs. In Bayesian modeling, this allows researchers to assess the probability of hypotheses directly.

While the two-condition example serves as a preparatory step, the tutorial extends these concepts to a more complex 2×22\times 2 factorial design. This section demonstrates how the Bayesian framework and Stan's matrix formulation can be generalized to accommodate factorial designs, making it suitable for a wide array of experimental setups. Such flexibility signifies the power of Stan in handling sophisticated models, enabling researchers to investigate intricate effects in their data.

The paper concludes by suggesting further readings for researchers interested in deepening their understanding of Bayesian modeling. A list of recommended textbooks is provided, catering to varying levels of technical expertise and backgrounds, thereby supporting the reader in advancing their knowledge of Bayesian statistics.

The implications of adopting Bayesian LMMs for research in psychology, linguistics, and cognitive science are substantial. Bayesian models offer richer interpretations of data by incorporating prior information and providing probabilistic statements regarding hypotheses. Moreover, they facilitate the fitting of models that are not tractable under frequentist methodologies, thereby potentially advancing theoretical and experimental investigations in these domains.

In summary, Sorensen and Vasishth's tutorial is a valuable contribution for researchers seeking to navigate the complexities of Bayesian linear mixed models using Stan. The step-by-step approach, combined with practical examples, serves as a solid foundation for integrating Bayesian methods into empirical research frameworks. This tutorial paves the way for the broader application of Bayesian techniques, potentially igniting new discussions and innovations in experimental research methodologies.

X Twitter Logo Streamline Icon: https://streamlinehq.com