I was reading through the material on the mediation formulas [1] and do not understand how to apply it in cases where Y, the outcome is binary and Pr(Y) is estimated using logistic regression and Z, the mediator is continuous.
All the texts I have referred to suggest that there is no closed form solution when Pr(Y) is estimated using logistic regression but there is a closed form when probit regression is used. I was trying to figure this out by applying the mediation formulas using the simplest case where we have:
X where x = control, x' = treatment,
Z is a continuous mediator
Y is a continuous outcome
Setting this mediation up, we have:
[Eq1] $Y = \beta_0 + \beta_1X_y + \beta_2Z + \varepsilon_1$
[Eq2] $Z = \gamma_0 + \gamma_1X_z + \varepsilon_2$
And the mediation formulas state:
[Eq3] Direct effect, $DE_{x,x'}(Y) = E(Y_{x', Z_x}) - E(Y_x)$
[Eq4] Indirect effect, $IE_{x,x'}(Y) = E(Y_{x, Z_{x'}}) - E(Y_x)$
Under no confounding, we have:
[Eq5] $DE_{x,x'}(Y) = \sum_{z}{[E(Y|x', z) - E(Y|x,z)] P(z|x)}$
[Eq6] $IE_{x,x'}(Y) = \sum_{z}{E(Y|x, z)[P(z|x') - P(z|x)}$
First question:
Are [Eq3] and [Eq4] re-expressions of pure direct [Eq7] and total indirect effects [Eq8] as presented in many other literature?
[Eq7] $DE_{x,x'}(Y) = E[Y(x', Z(x)) - Y(x, Z(x))]$
[Eq8] $IE_{x,x'}(Y) = E[Y(x', Z(x')) - Y(x', Z(x))]$
If it is, then why is [Eq4] not [Eq9]?
[Eq9] $IE_{x,x'}(Y) = E(Y_{x', Z_{x'}}) - E(Y_{x'})$
Second question:
How should [Eq5] be applied? In this case, Z is a continuous variable so what should P(z|x) be? I see in various other sources that suggest that when all variables are continuous, you can just substitute in the terms as in [Exp1].
[Exp1] $DE_{x,x'}(Y) = [\beta_0 + \beta_1x' + \beta_2 * (\gamma_0 + \gamma_1x)] - [\beta_0 + \beta_1x + \beta_2 * (\gamma_0 + \gamma_1x)]$
[Exp1] appears to follow [Eq7] but I do not follow how this is an application of [Eq5].
I was hoping that understanding how [Eq5] and [Eq6] are applied in the continuous Z and Y case can help me understand why there is no closed form expression for the direct and indirect effects of the following mediation model:
[Eq10] $Pr(Y) = [1 + exp({-(\beta_0 + \beta_1X_y + \beta_2Z + \varepsilon_1)})]^{-1}$
[Eq11] $Z = \gamma_0 + \gamma_1X_z + \varepsilon_2$
where
$\varepsilon_1$ follows a logistic distribution
$\varepsilon_2$ follows a normal distribution
[1] Pearl J. The Causal Mediation Formula - A Guide to the Assessment of Pathways and Mechanisms. Prevention Science. 2012 Aug;13(4):426–36.