Hi everyone,
I’m looking for advice on how to conduct mediation analysis in a situation where:
I then tried gsem with the following model specification:
To estimate indirect effects, I used:
With this code, I get the following results:
My questions:
Thank you in advance for any insights or recommendations!
I’m looking for advice on how to conduct mediation analysis in a situation where:
- The treatment (X) is binary
- There are two mediators (M1 and M2) which are continuous and correlated with one another (~0.65)
- The outcome (Y) is binary
- I have controls (C1–C3)
- I want to incorporate survey weights due to complex survey design.
I then tried gsem with the following model specification:
Code:
gsem (M1 <- X C1 C2 C3, family(gaussian)) /// (M2 <- X C1 C2 C3, family(gaussian)) /// (Y <- X M1 M2 C1 C2 C3, family(binomial) link(logit)) [pweight=W], /// nocapslatent covariance(e.M1*e.M2)
Code:
nlcom (indirect_M1: _b[M1:X]*_b[Y*M1]) /// (indirect_M2: _b[M2:X]*_b[Y*M2]) /// (total_indirect: (_b[M1:X]*_b[Y*M1]) + (_b[M2:X]*_b[Y*M2])) /// (total_effect: _b[Y*X] + (_b[M1:X]*_b[Y*M1]) + (_b[M2:X]*_b[Y*M2]))
Code:
------------------------------------------------------------------------------- | Coefficient Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- indirect_M1 | .0602089 .0125258 4.81 0.000 .0356588 .084759 indirect_M2 | .1230778 .017646 6.97 0.000 .0884922 .1576634 total_indir~t | .1832867 .0232965 7.87 0.000 .1376263 .228947 total_effect | .6485873 .0899088 7.21 0.000 .4723693 .8248052
My questions:
- I’m new to mediation analysis and want to confirm whether my approach is valid: Is it appropriate to model mediation with two correlated continuous mediators simultaneously in gsem when the outcome is binary? Being new to mediation analysis and gsem, I’d also be grateful for any help interpreting these results.
- Am I correctly specifying the covariance of residuals between the two mediators using covariance(e.M1*e.M2) in the gsem command?
- Is my nlcom syntax correct for estimating the indirect effects through each mediator, their total indirect effect, and the total effect?
- Regarding survey weights: Am I incorporating them properly in this gsem mediation model? I notice that weighted and unweighted results (the latter are reported below) differ substantially. The dataset documentation recommends always using weights to account for complex survey design.
Code:
------------------------------------------------------------------------------- | Coefficient Std. err. z P>|z| [95% conf. interval] --------------+---------------------------------------------------------------- indirect_M1 | .026378 .004768 5.53 0.000 .017033 .035723 indirect_M2 | .0549647 .0090522 6.07 0.000 .0372228 .0727066 total_indir~t | .0813427 .0113735 7.15 0.000 .0590511 .1036344 total_effect | .381957 .0523959 7.29 0.000 .2792629 .4846511
Comment