Note: This tutorial was initially published on an older version of my website in 2015, and has only been lightly edited on the post date listed. The content introducing mediation analysis is in need of updating, and in particular the assumptions and proper specification of mediation analysis models so as to have a better understanding of the involved causal processes.

Researchers in psychology and other social sciences are often interested in performing mediation analysis to explain the relationship between an independent variable (X) and dependent variable (Y) in terms of a third hypothesized process or mediating variable (M). Often there is a hypothesis that the variables are causally related. For instance, it is often hypothesized that X causes changes in M, represented by the coefficient \(a\) in the Figure below, and that M causes changes in Y as represented by the coefficient \(b\). Assuming all continuous variables, the product of the coefficients \(ab\) is called the *indirect effect* of X on Y that passes through M.