I have constructed a structural equation model in R using lavaan, with 2 exogenous predictor variables, 3 mediators, and 1 endogenous response variable:
I tried to label it as conventionally as possible but apologies if I didn't do a good job. I am now trying to calculate indirect effects, using past answers on how to set it up in lavaan (here), and how to incorporate more than one mediator (here and here). But I am unsure on how to go about it with two predictor values (X1 and X2), as this would count some indirect pathways twice, right? That doesn't seem statistically sound to me but I don't know how to go about it.
Here is what I've written so far, assuming just one X1 value and one indirect path of interest via M3:
model1 <- '
M1 ~ a1*X1 + e1*M2
M2 ~ a2*X1
M3 ~ a3*X1 + b1*M1 + b3*M2
Y ~ c1*X1 + b2*M1 + b4*M2 + d1*M3
ind_eff := a3 * d1
tot_eff := c1 + a1*b1*d1 + a1*b2+ a2*e1*b1*d1 + a2*e1*b2 + a2*b3*d1 + a2*b4 + a3*d1
'
Have I written this correctly so far (particularly the total effect calculation)? Is it possible to combine this with a model for X2 together into just one model, even if it means some pathways like b1 will be used twice?