IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0287037.html
   My bibliography  Save this article

BayesGmed: An R-package for Bayesian causal mediation analysis

Author

Listed:
  • Belay B Yimer
  • Mark Lunt
  • Marcus Beasley
  • Gary J Macfarlane
  • John McBeth

Abstract

Background: The past decade has seen an explosion of research in causal mediation analysis. However, most analytic tools developed so far rely on frequentist methods which may not be robust in the case of small sample sizes. In this paper, we propose a Bayesian approach for causal mediation analysis based on Bayesian g-formula, which will overcome the limitations of the frequentist methods. Methods: We created BayesGmed, an R-package for fitting Bayesian mediation models in R. The application of the methodology (and software tool) is demonstrated by a secondary analysis of data collected as part of the MUSICIAN study, a randomised controlled trial of remotely delivered cognitive behavioural therapy (tCBT) for people with chronic pain. We tested the hypothesis that the effect of tCBT would be mediated by improvements in active coping, passive coping, fear of movement and sleep problems. We then demonstrate the use of informative priors to conduct probabilistic sensitivity analysis around violations of causal identification assumptions. Result: The analysis of MUSICIAN data shows that tCBT has better-improved patients’ self-perceived change in health status compared to treatment as usual (TAU). The adjusted log-odds of tCBT compared to TAU range from 1.491 (95% CI: 0.452–2.612) when adjusted for sleep problems to 2.264 (95% CI: 1.063–3.610) when adjusted for fear of movement. Higher scores of fear of movement (log-odds, -0.141 [95% CI: -0.245, -0.048]), passive coping (log-odds, -0.217 [95% CI: -0.351, -0.104]), and sleep problem (log-odds, -0.179 [95% CI: -0.291, -0.078]) leads to lower odds of a positive self-perceived change in health status. The result of BayesGmed, however, shows that none of the mediated effects are statistically significant. We compared BayesGmed with the mediation R- package, and the results were comparable. Finally, our sensitivity analysis using the BayesGmed tool shows that the direct and total effect of tCBT persists even for a large departure in the assumption of no unmeasured confounding. Conclusion: This paper comprehensively overviews causal mediation analysis and provides an open-source software package to fit Bayesian causal mediation models.

Suggested Citation

  • Belay B Yimer & Mark Lunt & Marcus Beasley & Gary J Macfarlane & John McBeth, 2023. "BayesGmed: An R-package for Bayesian causal mediation analysis," PLOS ONE, Public Library of Science, vol. 18(6), pages 1-14, June.
  • Handle: RePEc:plo:pone00:0287037
    DOI: 10.1371/journal.pone.0287037
    as

    Download full text from publisher

    File URL: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0287037
    Download Restriction: no

    File URL: https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0287037&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pone.0287037?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Tingley, Dustin & Yamamoto, Teppei & Hirose, Kentaro & Keele, Luke & Imai, Kosuke, 2014. "mediation: R Package for Causal Mediation Analysis," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 59(i05).
    2. Imai, Kosuke & Yamamoto, Teppei, 2013. "Identification and Sensitivity Analysis for Multiple Causal Mechanisms: Revisiting Evidence from Framing Experiments," Political Analysis, Cambridge University Press, vol. 21(2), pages 141-171, April.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Martin Huber & Yu‐Chin Hsu & Ying‐Ying Lee & Layal Lettry, 2020. "Direct and indirect effects of continuous treatments based on generalized propensity score weighting," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 35(7), pages 814-840, November.
    2. Adam C. Sales, 2017. "Review," Journal of Educational and Behavioral Statistics, , vol. 42(1), pages 69-84, February.
    3. Cammett, Melani & Şaşmaz, Aytuğ, 2017. "Political Context, Organizational Mission, and the Quality of Social Services: Insights from the Health Sector in Lebanon," World Development, Elsevier, vol. 98(C), pages 120-132.
    4. Jing Peng, 2023. "Identification of Causal Mechanisms from Randomized Experiments: A Framework for Endogenous Mediation Analysis," Information Systems Research, INFORMS, vol. 34(1), pages 67-84, March.
    5. Brown, Martin & Henchoz, Caroline & Spycher, Thomas, 2018. "Culture and financial literacy: Evidence from a within-country language border," Journal of Economic Behavior & Organization, Elsevier, vol. 150(C), pages 62-85.
    6. Ward, Jeffrey T. & Hartley, Richard D. & Tillyer, Rob, 2016. "Unpacking gender and racial/ethnic biases in the federal sentencing of drug offenders: A causal mediation approach," Journal of Criminal Justice, Elsevier, vol. 46(C), pages 196-206.
    7. Hsu Yu-Chin & Huber Martin & Lai Tsung-Chih, 2019. "Nonparametric estimation of natural direct and indirect effects based on inverse probability weighting," Journal of Econometric Methods, De Gruyter, vol. 8(1), pages 1-20, January.
    8. Brown, Martin & Henchoz, Caroline & Spycher, Thomas, 2017. "Culture and Financial Literacy," Working Papers on Finance 1703, University of St. Gallen, School of Finance.
    9. Matthew G. Cox & Yasemin Kisbu-Sakarya & Milica MioÄ ević & David P. MacKinnon, 2013. "Sensitivity Plots for Confounder Bias in the Single Mediator Model," Evaluation Review, , vol. 37(5), pages 405-431, October.
    10. Natalie DeForest & Yuqi Wang & Zhiyi Zhu & Jacqueline S. Dron & Ryan Koesterer & Pradeep Natarajan & Jason Flannick & Tiffany Amariuta & Gina M. Peloso & Amit R. Majithia, 2024. "Genome-wide discovery and integrative genomic characterization of insulin resistance loci using serum triglycerides to HDL-cholesterol ratio as a proxy," Nature Communications, Nature, vol. 15(1), pages 1-17, December.
    11. Acharya, Avidit & Blackwell, Matthew & Sen, Maya, 2016. "Explaining Causal Findings Without Bias: Detecting and Assessing Direct Effects," American Political Science Review, Cambridge University Press, vol. 110(3), pages 512-529, August.
    12. Parker Hevron, 2018. "Judicialization and Its Effects: Experiments as a Way Forward," Laws, MDPI, vol. 7(2), pages 1-21, May.
    13. Atanasov, Pavel & Witkowski, Jens & Ungar, Lyle & Mellers, Barbara & Tetlock, Philip, 2020. "Small steps to accuracy: Incremental belief updaters are better forecasters," Organizational Behavior and Human Decision Processes, Elsevier, vol. 160(C), pages 19-35.
    14. Shengkui Zhang & Yongbin Wang & Ying Zhu & Xiaoming Li & Yang Song & Juxiang Yuan, 2020. "Rotating Night Shift Work, Exposure to Light at Night, and Glomerular Filtration Rate: Baseline Results from a Chinese Occupational Cohort," IJERPH, MDPI, vol. 17(23), pages 1-14, December.
    15. Antonio R. Linero, 2022. "Simulation‐based estimators of analytically intractable causal effects," Biometrics, The International Biometric Society, vol. 78(3), pages 1001-1017, September.
    16. Shengkui Zhang & Han Wang & Yongbin Wang & Miao Yu & Juxiang Yuan, 2021. "Association of Rotating Night Shift Work with Body Fat Percentage and Fat Mass Index among Female Steelworkers in North China," IJERPH, MDPI, vol. 18(12), pages 1-15, June.
    17. Vonneilich, Nico & Lüdecke, Daniel & von dem Knesebeck, Olaf, 2020. "Educational inequalities in self-rated health and social relationships – analyses based on the European Social Survey 2002-2016," Social Science & Medicine, Elsevier, vol. 267(C).
    18. Martin Huber & Michael Lechner & Giovanni Mellace, 2017. "Why Do Tougher Caseworkers Increase Employment? The Role of Program Assignment as a Causal Mechanism," The Review of Economics and Statistics, MIT Press, vol. 99(1), pages 180-183, March.
    19. Erin Percival Carter & Stephanie Welcomer, 2021. "Designing and Distinguishing Meaningful Artisan Food Experiences," Sustainability, MDPI, vol. 13(15), pages 1-13, July.
    20. Sato, Yukihiro & Aida, Jun & Tsuboya, Toru & Shirai, Kokoro & Koyama, Shihoko & Matsuyama, Yusuke & Kondo, Katsunori & Osaka, Ken, 2018. "Generalized and particularized trust for health between urban and rural residents in Japan: A cohort study from the JAGES project," Social Science & Medicine, Elsevier, vol. 202(C), pages 43-53.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pone00:0287037. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: plosone (email available below). General contact details of provider: https://journals.plos.org/plosone/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.