Bayesian Correlation Analysis

When it comes to drawing statistical conclusions from data, classical (frequentist) inferential procedures are of widespread use. Yet, their results are subject to constant misuse (García-Pérez, 2012) and misinterpretation (Hoekstra et. al., 2014), thus impairing the validity of statistical and scientific conclusions. Recent criticism against the Null Hypothesis Testing Procedure (NHSTP) has propelled the development and refinement of Bayesian hypothesis testing procedures, which are deemed free of the problems that hamper frequentist analyses.

The present app performs two-sided tests for Pearson's correlation in a Bayesian hypothesis testing framework. The Bayes Factor (BF), upon which statistical conclusions are based, quantifies the evidence in favor of a given hypothesis, as opposed to another (Kass & Raftery, 1995). Here, a null hypothesis H0: ρ = 0 is tested against an alternative hypothesis H1: ρ ≠ 0, where ρ is the true linear correlation. The procedure implemented in this app was developed by Zellner (1986), further elaborated by Liang et. al. (2008), and thoroughly presented in Wetzels & Wagenmakers (2012).

The app consists on four different tabs that are organized as follows. All tabs perform the above test, showing its corresponding prior and posterior distributions, as well as the value of the BF for the null hypothesis (BF01) and the value of the BF for the alternative (BF10). In addition, the app displays the scatterplot and histograms of both variables, as well as a summary of some inferential statistics.

The first tab simulates data from a bivariate Normal distribution as shown by Demritas (2004). The user can change the value of the true linear correlation, the sample size, and the width of the stretched Beta prior distribution. The second tab incorporates a more versatile interface for generating data, where the user can add individual observations by clicking anywhere on the scatterplot. And whilst the third tab includes different sample data sets, the fourth and final tab allows the user to upload their own data sets.

All in all, the "Bayesian correlation analysis" app shows how the results of Bayesian procedures vary in the light of changes regarding data and prior beliefs.


  1. Demirtas, H. (2004). Pseudo-Random Number Generation In R For Com- monly Used Mul- tivariate Distributions. Journal of Modern Applied Statistical Methods, 3(2), em>19.
  2. García-Pérez, M. A. (2012). Statistical conclusion validity: Some common threats and simple remedies. Sweating the small stuff: does data cleaning and testing of assumptions really matter in the 21st century?, em>17-27.
  3. Hoekstra, R., Morey, R. D., Rouder, J. N., & Wagenmakers, E. J. (2014). Robust misinterpretation of confidence intervals. Psychonomic Bulletin \& Review, 21(5), 1157-1164.
  4. Kass, R. E., & Raftery, A. E. (1995). Bayes factors. Journal of the American Statistical Association, 90(430), 773-795.
  5. Liang, F., Paulo, R., Molina, G., Clyde, M., \& Berger, J. (2008). Mixtures of g Priors for Bayesian Variable Selection. Journal of the American Statistical Association, 103, 410.
  6. Ly, A., Verhagen, A. J., & Wagenmakers, E.-J. (2016). Harold Jeffreys's default Bayes factor hypothesis tests: Explanation, extension, and application in psychology. Journal of Mathematical Psychology, 72, 19-32.
  7. Ly, A., Marsman, M., & Wagenmakers, E.-J. (2016). Analytic posteriors for Pearson's correlation coefficient. ArXiv preprint arXiv:1510.01188.
  8. Wagenmakers, E.-J., Verhagen, A. J., & Ly, A. (2016). How to quantify the evidence for the absence of a correlation. Behavior Research Methods, 48, 413-426.
  9. Wetzels, R., & Wagenmakers, E. J. (2012). A default Bayesian hypothesis test for correlations and partial correlations. Psychonomic Bulletin \& Review, 19(6), 1057-1064.
  10. Zellner, A. (1986). On assessing prior distributions and Bayesian regression analysis with g-prior distributions. Bayesian Inference and Decision Techniques: Essays in Honor of Bruno de Finetti, 233243.

TquanT was co-funded by the Erasmus+ Programme of the European Commission.

This server is powered by RStudio's Shiny Server Open Source.

© 2016, Berenice López-Casal, Universidad Complutense de Madrid, Spain & E.J. Wagenmakers, University of Amsterdam, The Netherlands

Legal Disclaimer | Privacy Information