I'm trying to calculate the total indirect effects in a structural equation model with four exogenous latent variables, four latent mediators, and one outcome variable. Mplus gives the option for the "sum of indirect effects", but I'm not sure how to get this information in 'lavaan'. I found a paper that reported the sum of indirect effects from 'lavaan', but I'm not sure how to run this analysis.
Solved – Total indirect effects: Structural equation modeling
lavaanmplusrstructural-equation-modeling
Related Solutions
Structural Equation Modeling – Estimating Direct and Total Effects with Regressions and SEM (lavaan)
Drawing back to the world of mediation as defined by Baron & Kenny (1986), you would typically test a mediation model using separate regression equations. According to this approach the researcher would seek to demonstrate a series of conditions, which if they held, would constitute evidence of mediation. The first condition is demonstrated by your first regression model lm(Y~X, data=Data)
. This shows that there is a significant overall effect of $X$ on $Y$ (side note: this is also the total effect).
The next condition to test is to show that $X$ is significantly related to $M$. This is missing from your modeling, but can be easily estimated based on the data you generated.
> summary(lm(M~X))
Call:
lm(formula = M ~ X)
Residuals:
Min 1Q Median 3Q Max
-2.88626 -0.61401 0.00236 0.58645 2.98774
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.03715 0.10498 0.354 0.724
X 0.47392 0.10378 4.567 1.44e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.037 on 98 degrees of freedom
Multiple R-squared: 0.1755, Adjusted R-squared: 0.1671
F-statistic: 20.85 on 1 and 98 DF, p-value: 1.442e-05
Here we can see that indeed the second condition of mediation is met as $X$ significantly predicts $M$. Also note that you get the same unstandardized regression coefficient .474
in this model as you do in the SEM model above.
Following the Baron and Kenny approach the next two conditions are tested simultaneously in one final regression model. First, controlling for $X$, $M$ should significantly predict $Y$, which it does in your model above. Second, the relation between $X$ and $Y$ should be attenuated when controlling for $M$. This condition is also met according to your model above.
To calculate the significance of the mediation (i.e., the indirect effect), researchers tended to use Sobel's Test, at least when the full Baron and Kenny approach was still in vogue. To perform this test you needed to take the direct effect of $X$ on $M$ (from regression model #2) and multiply it by the direct effect of $M$ on $Y$, controlling for $X$ (to calculate significance you also needed the standard errors for these regression coefficients).
An SEM model tests all of these same conditions and can assess the significance of mediation in one step essentially. Note that all of the elements needed for a Sobel's test are in the single SEM model. Also note that all of the coefficients are essentially the same as those you calculated using the linear regression framework proposed originally by Baron and Kenny.
Perhaps the issue comes down to parlance? The total effect in a mediation model is sometimes delineated as $c$ (it is necessarily the unconditional effect of $X$ on $Y$). The direct effect of $X$ on $Y$ conditioned on $M$ is often notated as $c'$ where $c' + a*b = c$. These are terminology conventions used by researchers in reference to mediation models specifically and may not translate perfectly to all other uses of the terms "total effect" and "direct effect" in the world of statistics.
Best Answer
In Lavaan you can calculate new parameters, using the := operator.
Use this to calculate the sum of indirect effects. Here's an example. We have 4 predictors (x1-x4), one mediator (m) and one outcome (y).