Tutorial: Doing Bayesian Data Analysis with R and BUGS

Tutorial: Doing Bayesian Data Analysis with R and BUGS John K. Kruschke (kruschke@indiana.edu) Department of Psychological and Brain Sciences, Indiana University 1101 E. 10th St., Bloomington, IN USA Before arriving, install free software and get more information from this web site: http://www.indiana.edu/∼jkkteach/CogSci2011Tutorial.html Keywords: Data analysis (Bayesian); Statistics (Bayesian); Markov chain Monte Carlo; Bayesian models; Hierarchical models An introduction to doing Bayesian data analysis This full-day tutorial shows you how to do Bayesian data analysis, hands on. The software is free. The intended au- dience is graduate students and other researchers who want a ground-floor introduction to Bayesian data analysis. No mathematical expertise is presumed. The full-day tutorial progresses through the following topics. Figure 1: Concepts and methods of Bayesian data analy- sis (left) transfer to Bayesian models of mind (right), but Bayesian data analysis with generic descriptive models will be useful even when specific Bayesian models of mind fail to mimic behavior. 9:00-10:30 Bayes’ Rule, Grid Approximation, and R. We start with the basics of conditional probabilities, the meaning of Bayes’ rule, and simple examples of Bayes’ rule graphically illustrated with grid approximation in the programming language R. cesses that generated the data. Bayesian methods infer cred- ible values of parameters in the descriptive models, such as credible slopes and intercepts in linear regression, as sug- gested in the left side of Figure 1. Because the Bayesian approach to inference is the norma- tive approach, some cognitive scientists posit that cognitive processing itself is based on Bayesian inference by the mind, as suggested in the right side of Figure 1.When you learn about concepts and methods of Bayesian data analysis, it is easier to understand Bayesian models of mind, because the concepts transfer directly. But Bayesian data analysis will al- ways be useful, even if particular Bayesian models of mind fail to accurately mimic cognition. 11:00-12:30 MCMC and BUGS; Linear Regression. We explain the idea of approximating distributions by large representative samples, and Markov chain Monte Carlo (MCMC) methods for generating them. The BUGS language is introduced and used to do Bayesian linear regression. 1:30-3:00 Hierarchical Models and Model Comparison. Bayesian methods and the BUGS language make hierar- chical modeling straight forward. Hierarchical models are tremendously useful for analyzing individual differences, repeated measures, and structural constraints across conditions. Model comparison is a case of hierarchical modeling. Why go Bayesian? Modern Bayesian methods are the best approach to empirical data analysis because Bayesian methods yield richer infer- ences than traditional methods and without use of ill-defined p values. Sciences from astronomy to zoology are chang- ing from 20th-century null-hypothesis significance testing to Bayesian data analysis. Figure 2 (humorously) suggests this trend. Bayesian data analysis delivers many practical benefits: 3:30-5:00 Bayesian ANOVA; Power Analysis. We use hi- erarchical analysis of variance (ANOVA) with Bayesian parameter estimates, for rich and flexible inferences about differences between groups. We conclude with a brief look at power analysis from a Bayesian perspective. Concepts and methods of Bayesian data analysis transfer to Bayesian models of cognition • Bayesian methods permit model flexibility and appropri- ateness: Hierarchical models can be built easily to suit the design of the experiment and the type of data measured. Such models can be easily extended to capture individual Bayesian data analysis uses generic descriptive models such as linear regression, without any assertions about the pro-