Skip to main content
Tutorial

A Tutorial in Bayesian Mediation Analysis With Latent Variables

Published Online:https://doi.org/10.1027/1614-2241/a000177

Abstract. Maximum Likelihood (ML) estimation is a common estimation method in Structural Equation Modeling (SEM), and parameters in such analyses are interpreted using frequentist terms and definition of probability. It is also possible, and sometimes more advantageous (Lee & Song, 2004; Rindskopf, 2012), to fit structural equation models in the Bayesian framework (Kaplan & Depaoli, 2012; Levy & Choi, 2013; Scheines, Hoijtink, & Boomsma, 1999). Bayesian mediation analysis has been described for manifest variable models (Enders, Fairchild, & MacKinnon, 2013; Yuan & MacKinnon, 2009). This tutorial outlines considerations in the analysis and interpretation of results for the single mediator model with latent variables. The reader is guided through model specification, estimation, and the interpretations of results obtained using two kinds of diffuse priors and one set of informative priors. Recommendations are made for applied researchers and annotated syntax is provided in R2OpenBUGS and Mplus. The target audience for this article are researchers wanting to learn how to fit the single mediator model as a Bayesian SEM.

References

  • Baron, R. M., & Kenny, D. A. (1986). The moderator–mediator variable distinction in social psychological research: Conceptual, strategic, and statistical considerations. Journal of Personality and Social Psychology, 51, 1173–1182. https://doi.org/10.1037/0022-3514.51.6.1173 First citation in articleCrossrefGoogle Scholar

  • Brooks, S. P. (1998). Markov chain Monte Carlo method and its application. The Statistician, 47, 69–100. https://doi.org/10.1111/1467-9884.00117 First citation in articleGoogle Scholar

  • Craig, C. C. (1936). On the frequency function of xy. Annals of Mathematical Statistics, 7, 1–15. https://doi.org/10.1214/aoms/1177732541 First citation in articleCrossrefGoogle Scholar

  • Cremers, J., Mainhard, T., & Klugkist, I. (2018). Assessing a Bayesian embedding approach to circular regression models. Methodology, 14, 69–81. https://doi.org/10.1027/1614-2241/a000147 First citation in articleLinkGoogle Scholar

  • Depaoli, S., & van de Schoot, R. (2017). Improving transparency and replication in Bayesian statistics: The WAMBS-Checklist. Psychological Methods, 22, 240–261. https://doi.org/10.1037/met0000065 First citation in articleCrossrefGoogle Scholar

  • Enders, C. K., Fairchild, A. J., & MacKinnon, D. P. (2013). A Bayesian approach to estimating mediation effects with missing data. Multivariate Behavioral Research, 48, 340–369. https://doi.org/10.1080/00273171.2013.784862 First citation in articleCrossrefGoogle Scholar

  • Finch, J. F., West, S. G., & MacKinnon, D. P. (1997). Effects of sample size and nonnormality on the estimation of mediated effects in latent variable models. Structural Equation Modeling: A Multidisciplinary Journal, 4, 87–107. https://doi.org/10.1080/10705519709540063 First citation in articleCrossrefGoogle Scholar

  • Gelman, A. (2006). Prior distributions for variance parameters in hierarchical models. Bayesian Analysis, 1, 515–534. https://doi.org/10.1214/06-ba117a First citation in articleCrossrefGoogle Scholar

  • Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2014). Bayesian data analysis. Boca Raton, FL: CRC Press. First citation in articleGoogle Scholar

  • Gelman, A., & Meng, X. L. (1996). Model checking and model improvement. In W. R. GilksS. RichardsonD. J. SpiegelhalterEds., Markov chain Monte Carlo in practice (pp. 189–201). Boca Raton, FL: Chapman & Hall/CRC. First citation in articleGoogle Scholar

  • Gelman, A., Meng, X. L., & Stern, H. (1996). Posterior predictive assessment of model fitness via realized discrepancies. Statistica Sinica, 6, 733–807. First citation in articleGoogle Scholar

  • Gelman, A., & Rubin, D. B. (1992). Inference from iterative simulation using multiple sequences. Statistical Science, 7, 457–472. https://doi.org/10.1214/ss/1177011136 First citation in articleCrossrefGoogle Scholar

  • Gelman, A., & Shirley, K. (2011). Inference from simulations and monitoring convergence. In S. BrooksA. GelmanG. L. JonesX. L. MingEds., Handbook of Markov Chain Monte Carlo (pp. 163–174). Boca Raton, FL: Chapman & Hall/CRC. First citation in articleGoogle Scholar

  • Gill, J. (2008). Bayesian methods: A social and behavioral science approach. Boca Raton, FL: Chapman & Hall. First citation in articleGoogle Scholar

  • Hamaker, E. L., van Hattum, P., Kuiper, R. M., & Hoijtink, H. (2011). Model selection based on information criteria in multilevel modeling. In J. J. HoxJ. K. RobertsEds., Handbook of advanced multilevel analysis (pp. 231–255). New York, NY: Routledge. First citation in articleGoogle Scholar

  • Haselager, G. J. T., & van Aken, M. A. G. (2000). Personality and family relationships. DANS. https://doi.org/10.17026/dans-xk5-y7vc First citation in articleGoogle Scholar

  • Hoyle, R. H., & Kenny, D. A. (1999). Statistical power and tests of mediation. In R. H. HoyleEd., Statistical strategies for small sample research (pp. 195–222). Newbury Park, CA: Sage. First citation in articleGoogle Scholar

  • Jackman, S. (2009). Bayesian analysis for the social sciences. New York, NY: Wiley. First citation in articleCrossrefGoogle Scholar

  • James, L. R., & Brett, J. M. (1984). Mediators, moderators, and tests for mediation. Journal of Applied Psychology, 69, 307–321. https://doi.org/10.1037/0021-9010.69.2.307 First citation in articleCrossrefGoogle Scholar

  • Judd, C. M., & Kenny, D. A. (1981). Process analysis estimating mediation in treatment evaluations. Evaluation Review, 5, 602–619. https://doi.org/10.1177/0193841x8100500502 First citation in articleCrossrefGoogle Scholar

  • Kadane, J. B. (2015). Bayesian methods for prevention research. Prevention Science, 16, 1017–1025. https://doi.org/10.1007/s11121-014-0531-x First citation in articleCrossrefGoogle Scholar

  • Kaplan, D., & Depaoli, S. (2012). Bayesian structural equation modeling. In R. HoyleEd., Handbook of structural equation modeling (pp. 650–673). New York, NY: Guilford Press. First citation in articleGoogle Scholar

  • Kruschke, J. (2014). Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Cambridge, MA: Academic Press. First citation in articleGoogle Scholar

  • Ledgerwood, A., & Shrout, P. E. (2011). The trade-off between accuracy and precision in latent variable models of mediation processes. Journal of Personality and Social Psychology, 101, 1174–1188. https://doi.org/10.1037/a0024776 First citation in articleCrossrefGoogle Scholar

  • Lee, S. Y., & Song, X. Y. (2004). Evaluation of the Bayesian and maximum likelihood approaches in analyzing structural equation models with small sample sizes. Multivariate Behavioral Research, 39, 653–686. https://doi.org/10.1207/s15327906mbr3904_4 First citation in articleCrossrefGoogle Scholar

  • Levy, R., & Choi, J. (2013). Bayesian structural equation modeling. In G. R. HancockR. O. MuellerEds., Structural equation modeling: A second course (2nd ed., pp. 563–623). Charlotte, NC: Information Age Publishing. First citation in articleGoogle Scholar

  • Link, W. A., & Eaton, M. J. (2012). On thinning of chains in MCMC. Methods in Ecology and Evolution, 3, 112–115. https://doi.org/10.1111/j.2041-210x.2011.00131.x First citation in articleCrossrefGoogle Scholar

  • Lomnicki, Z. A. (1967). On the distribution of products of random variables. Journal of the Royal Statistical Society, 29, 513–524. https://doi.org/10.21236/ad0660189 First citation in articleGoogle Scholar

  • Lunn, D. J., Thomas, A., Best, N., & Spiegelhalter, D. (2000). OpenBUGS – a Bayesian modelling framework: concepts, structure, and extensibility. Statistics and Computing, 10, 325–337. https://doi.org/10.1023/a:1008929526011 First citation in articleCrossrefGoogle Scholar

  • MacCallum, R. C., Edwards, M. C., & Cai, L. (2012). Hopes and cautions in implementing Bayesian structural equation modeling. Psychological Methods, 17, 340–346. https://doi.org/10.1037/a0027131 First citation in articleCrossrefGoogle Scholar

  • MacKinnon, D. P. (2008). Introduction to statistical mediation analysis. New York, NY: Erlbaum. First citation in articleGoogle Scholar

  • MacKinnon, D. P., Fritz, M. S., Williams, J., & Lockwood, C. M. (2007). Distribution of the product confidence limits for the indirect effect: Program PRODCLIN. Behavior Research Methods, 39, 384–389. https://doi.org/10.3758/bf03193007 First citation in articleCrossrefGoogle Scholar

  • MacKinnon, D. P., Lockwood, C. M., Hoffman, J. M., West, S. G., & Sheets, V. (2002). A comparison of methods to test mediation and other intervening variable effects. Psychological Methods, 7, 83–104. https://doi.org/10.1037/1082-989x.7.1.83 First citation in articleCrossrefGoogle Scholar

  • MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence limits for the indirect effect: Distribution of the product and resampling methods. Multivariate Behavioral Research, 39, 99–128. https://doi.org/10.1207/s15327906mbr3901_4 First citation in articleCrossrefGoogle Scholar

  • Meng, X. L. (1994). Posterior predictive p-values. The Annals of Statistics, 22, 1142–1160. https://doi.org/10.1214/aos/1176325622 First citation in articleCrossrefGoogle Scholar

  • Miočević, M., Gonzalez, O., Valente, M. J., & MacKinnon, D. P. (2018). A tutorial in Bayesian potential outcomes mediation analysis. Structural Equation Modeling: A Multidisciplinary Journal, 25, 121–136. https://doi.org/10.1080/10705511.2017.1342541 First citation in articleCrossrefGoogle Scholar

  • Miočević, M., Levy, R., & MacKinnon, D. P. (2019). Effects of accurate and inaccurate priors on statistical properties of the mediated effect. Manuscript submitted for publication. First citation in articleGoogle Scholar

  • Miočević, M., MacKinnon, D. P., & Levy, R. (2017). Power in Bayesian mediation analysis for small sample research. Structural Equation Modeling: A Multidisciplinary Journal, 24, 666–683. https://doi.org/10.1080/10705511.2017.1312407 First citation in articleCrossrefGoogle Scholar

  • Miočević, M., O’Rourke, H. P., MacKinnon, D. P., & Brown, H. C. (2017). Statistical properties of four effect-size measures for mediation models. Behavior Research Methods, 50, 1–17. https://doi.org/10.3758/s13428-017-0870-1 First citation in articleGoogle Scholar

  • Muthén, B., & Asparouhov, T. (2012). Bayesian structural equation modeling: A more flexible representation of substantive theory. Psychological Methods, 17, 313–335. https://doi.org/10.1037/a0026802 First citation in articleCrossrefGoogle Scholar

  • Muthén, L. K., & Muthén, B. O. (1998–2018). Mplus user’s guide (7th ed.). Los Angeles, CA: Muthén & Muthén. First citation in articleGoogle Scholar

  • Plummer, M. (2003, March). JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. In K. HornikF. LeischA. Zeileis (Eds.), Proceedings of the 3rd International Workshop on Distributed Statistical Computing (Vol. 124, pp. 1–10). Vienna, Austria: Technical University. Retrieved from https://www.r-project.org/conferences/DSC-2003/Proceedings/Plummer.pdf First citation in articleGoogle Scholar

  • Plummer, M., Best, N., Cowles, K., & Vines, K. (2006). CODA: Convergence diagnosis and output analysis for MCMC. R News, 6, 7–11. First citation in articleGoogle Scholar

  • R Core Team. (2014). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from https://www.r-project.org/ First citation in articleGoogle Scholar

  • Rindskopf, D. (2012). Next steps in Bayesian structural equation models: Comments on, variations of, and extensions to Muthén and Asparouhov (2012). Psychological Methods, 17, 336–339. https://doi.org/10.1037/a0027130 First citation in articleCrossrefGoogle Scholar

  • Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48, 1–36. https://doi.org/10.18637/jss.v048.i02 First citation in articleCrossrefGoogle Scholar

  • Scheines, R., Hoijtink, H., & Boomsma, A. (1999). Bayesian estimation and testing of structural equation models. Psychometrika, 64, 37–52. https://doi.org/10.1007/bf02294318 First citation in articleCrossrefGoogle Scholar

  • Schoot, R., Kaplan, D., Denissen, J., Asendorpf, J. B., Neyer, F. J., & van Aken, M. A. G (2014). A gentle introduction to Bayesian analysis: Applications to developmental research. Child Development, 85, 842–860. https://doi.org/10.1111/cdev.12169 First citation in articleCrossrefGoogle Scholar

  • Shrout, P. E., & Bolger, N. (2002). Mediation in experimental and nonexperimental studies: new procedures and recommendations. Psychological Methods, 7, 422–445. https://doi.org/10.1037/1082-989x.7.4.422 First citation in articleCrossrefGoogle Scholar

  • Sinharay, S. (2003). Assessing convergence of the Markov chain Monte Carlo algorithms: A review. ETS Research Report Series, 2003, i-52. First citation in articleCrossrefGoogle Scholar

  • Sinharay, S. (2004). Experiences with Markov chain Monte Carlo convergence assessment in two psychometric examples. Journal of Educational and Behavioral Statistics, 29, 461–488. https://doi.org/10.3102/10769986029004461 First citation in articleCrossrefGoogle Scholar

  • Song, X. Y., & Lee, S. Y. (2012). Basic and advanced Bayesian structural equation modeling: With applications in the medical and behavioral sciences. Hoboken, NJ: Wiley. First citation in articleCrossrefGoogle Scholar

  • Spiegelhalter, D. J., Best, N. G., Carlin, B. P., & Van Der Linde, A. (2002). Bayesian measures of model complexity and fit. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 64, 583–639. https://doi.org/10.1111/1467-9868.00353 First citation in articleCrossrefGoogle Scholar

  • Springer, M. D., & Thompson, W. E. (1966). The distribution of independent random variables. SIAM Journal on Applied Mathematics, 14, 511–526. https://doi.org/10.1137/0114046 First citation in articleCrossrefGoogle Scholar

  • Stan Development Team. (2015). Stan modeling language user’s guide and reference manual (Version 2.7.0). Retrieved from https://mc-stan.org/docs/2_20/reference-manual/index.html First citation in articleGoogle Scholar

  • StataCorp. (2017). Stata statistical software: Release 15. College Station, TX: StataCorp LLC. First citation in articleGoogle Scholar

  • Sturtz, S., Ligges, U., & Gelman, A. (2010). R2OpenBUGS: A package for running OpenBUGS from R. Retrieved from https://cran.rproject.org/web/packages/R2OpenBUGS/vignettes/R2OpenBUGS.pdf First citation in articleGoogle Scholar

  • Tofighi, D., & MacKinnon, D. P. (2011). RMediation: An R package for mediation analysis confidence intervals. Behavior Research Methods, 43, 692–700. https://doi.org/10.3758/s13428-011-0076-x First citation in articleCrossrefGoogle Scholar

  • Valente, M. J., Gonzalez, O., Miočević, M., & MacKinnon, D. P. (2016). A note on testing mediated effects in structural equation models: Reconciling past and current research on the performance of the test of joint significance. Educational and Psychological Measurement, 76, 889–911. https://doi.org/10.1177/0013164415618992 First citation in articleCrossrefGoogle Scholar

  • van de Schoot, R., Winter, S. D., Ryan, O., Zondervan-Zwijnenburg, M., & Depaoli, S. (2017). A systematic review of Bayesian articles in psychology: The last 25 years. Psychological Methods, 22, 217–239. https://doi.org/10.1037/met0000100 First citation in articleCrossrefGoogle Scholar

  • Vidotto, D., Vermunt, J. K., & Van Deun, K. (2018). Bayesian latent class models for the multiple imputation of categorical data. Methodology, 14, 56–68. https://doi.org/10.1027/1614-2241/a000146 First citation in articleLinkGoogle Scholar

  • Yuan, Y., & MacKinnon, D. P. (2009). Bayesian mediation analysis. Psychological Methods, 14, 301–322. https://doi.org/10.1037/a0016972 First citation in articleCrossrefGoogle Scholar

  • Zondervan-Zwijnenburg, M., Depaoli, S., Peeters, M., & van de Schoot, R. (2019). Pushing the Limits. Methodology, 15, 31–43. https://doi.org/10.1027/1614-2241/a000162 First citation in articleLinkGoogle Scholar

  • Zyphur, M. J., & Oswald, F. L. (2015). Bayesian estimation and inference: A user’s guide. Journal of Management, 41, 390–420. https://doi.org/10.1177/0149206313501200 First citation in articleCrossrefGoogle Scholar