BEST - Bayesian Estimation Supersedes the t-Test

Back to home page John Kruschke's BEST code for R is a nice introduction to Bayesian thinking for folks used to t-tests. I've referred to it, linked to it, and used it in workshops before now.

The idea is to provide an R function which is as easy to use as t.test but which gives not a mere p-value but the kind of output Bayesians are used to - posterior probability distributions. John's BESTmcmc function uses JAGS, but handles all the preliminaries automatically and produces a result in a simple format.

John put the R code on his university web site two years ago, blogged about it, and wrote a paper for the Journal of Experimental Psychology: General (Kruschke 2013)

Meanwhile, I had been looking for a practical example to introduce Bayesian analysis in the context of workshops devoted mainly to information theoretic methods. I'd tried examples in WinBUGS, but all the steps to get a result overwhelmed the central message of what it does. BEST seemed like a good solution. But to make it easier to install, and to facilitate handling the output with plot, print and summary methods, I wrapped John's code into an R package. We tried it out at workshops in Malaysia in January, and made a few changes as a result.

The BEST package is now on CRAN and you can download and install it from the Packages menu in R or with the command install.packages("BEST"). You will need JAGS; if necessary, download from sourceforge. JAGS (and BEST) run on Windows, Mac and Linux platforms.

The help files are quite extensive and include examples, and a vignette takes you through the analysis of a sample data set (use vignette("BEST") to open it).

You can get the R source code from CRAN as a .tar.gz file or from GitHub. If you have studied John's book, Doing Bayesian data analysis, you will recognise what it is doing and be able to adapt it to your own special needs.

If you encounter problems using BEST or if you have suggestions for additions or improvements, you can email me at mmeredith at wcs dot org.


Kruschke, J K. 2011. Doing Bayesian data analysis: a tutorial with R and BUGS. Elsevier, Amsterdam etc.

Kruschke, J K. 2013. Bayesian estimation supersedes the t test. Journal of Experimental Psychology: General 142:573-603.

Written 9 June 2013, links updated 5 March 2020 by Mike Meredith