Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2020;27(6):975-984.
doi: 10.1080/10705511.2020.1777133. Epub 2020 Aug 3.

Causal Mediation Programs in R, M plus, SAS, SPSS, and Stata

Affiliations

Causal Mediation Programs in R, M plus, SAS, SPSS, and Stata

Matthew J Valente et al. Struct Equ Modeling. 2020.

Abstract

Mediation analysis is a methodology used to understand how and why an independent variable (X) transmits its effect to an outcome (Y) through a mediator (M). New causal mediation methods based on the potential outcomes framework and counterfactual framework are a seminal advancement for mediation analysis, because they focus on the causal basis of mediation analysis. There are several programs available to estimate causal mediation effects, but these programs differ substantially in data set up, estimation, output, and software platform. To compare these programs, an empirical example is presented, and a single mediator model with XM interaction was estimated with a continuous mediator and a continuous outcome in each program. Even though the software packages employ different estimation methods, they do provide similar causal effect estimates for mediation models with a continuous mediator and outcome. A detailed explanation of program similarities, unique features, and recommendations are discussed.

Keywords: causal effects; counterfactual; estimation; mediation; software.

PubMed Disclaimer

Figures

Figure 1.
Figure 1.
(A) Path diagram depicting the single mediator model with treatment by mediator interaction (XM). (B) Path diagram depicting the single mediator model with treatment by mediator interaction (XM) and baseline covariate (C) confounding the X-M, M-Y, and X-Y relations.

Similar articles

Cited by

References

    1. Bollen KA (1989). Structural Equations with Latent Variables. New York: Wiley
    1. Bollen KA, & Stine R (1990). Direct and indirect effects: Classical and bootstrap estimates of variability. Sociological methodology, 115–140.
    1. Bullock JG, Green DP, & Ha SE (2010). Yes, but what’s the mechanism? (don’t expect an easy answer). Journal of Personality and Social Psychology, 98(4), 550. - PubMed
    1. Discacciati A, Bellavia A, Lee JJ, Mazumdar M, & Valeri L (2019). Med4way: a Stata command to investigate mediating and interactive mechanisms using the four-way effect decomposition. International Journal of Epidemiology, 48(1), 15–20. - PubMed
    1. Emsley R, & Liu H (2013). PARAMED: Stata module to perform causal mediation analysis using parametric regression models.

LinkOut - more resources