Serial mediation model - adjusting for covariance and covariates

66 views
Skip to first unread message

Margot

unread,
Aug 19, 2025, 2:00:39 PMAug 19
to lavaan
Hi everyone,

I'm new to using lavaan and am trying to specify a serial mediation model, and would really appreciate some advice as to how to potentially adjust for mediator covariance and include covariates in the model. 

The model is relatively simple with two serial mediators, and I had initially specified this as follows:

serMedModel <- '
M1 ~ a1 * X
M2 ~ a2 * X + d21 * M1
Y ~ cp * X + b1 * M1 + b2 * M2
ind_eff1 := a1 * b1
ind_eff2 := a2 * b2
ind_eff3 := a1 * d21 * b2
c := cp + a1 * d21 * b2 + a1 * b1 + a2 * b2
'

fit <- lavaan::sem(model = serMedModel, data = df, se = "boot", bootstrap = 5000)
lavaan::parameterEstimates(fit, boot.ci.type = "bca.simple")

Covariance:

However, reading through some conversations I have come across the suggestion that it is generally advised to adjust for covariance of the mediators, by adding the following:

M1 ~~  M2

Would that be correct in this case, or is that only applicable to parallel mediation? 

Covariates:

I would also like to re-run the analysis by adjusting for potential covariates. Am I right in thinking that would look something like this, if I were to add three covariates (CV1, CV2, and CV3)?

serMedModelCov <- '
M1 ~ a1 * X + c1 * CV1 + c2 * CV2 + c3 * CV3
M2 ~ a2 * X + d21 * M1 + 45 * CV1 + c5 * CV2 + 6
Y ~ cp * X + b1 * M1 + b2 * M2 + c7 * CV1 + c8 * CV2 + c9
ind_eff1 := a1 * b1
ind_eff2 := a2 * b2
ind_eff3 := a1 * d21 * b2
c := cp + a1 * d21 * b2 + a1 * b1 + a2 * b2
'

I would really appreciate any pointers, I've tried to have a go at it on my own but it'd be great to have some input about whether I'm on the right track! If there are any other details that would be helpful for me to post please do let me know. 


Terrence Jorgensen

unread,
Aug 22, 2025, 6:22:33 AMAug 22
to lavaan
M1 ~~  M2

Would that be correct in this case, or is that only applicable to parallel mediation
 
Indeed, your model will not be identified if you estimate this parameter, because you are already estimating that pairwise relationship as a regression slope.

Covariates:

I would also like to re-run the analysis by adjusting for potential covariates. Am I right in thinking that would look something like this, if I were to add three covariates (CV1, CV2, and CV3)?

serMedModelCov <- '
M1 ~ a1 * X + c1 * CV1 + c2 * CV2 + c3 * CV3
M2 ~ a2 * X + d21 * M1 + 45 * CV1 + c5 * CV2 + 6
Y ~ cp * X + b1 * M1 + b2 * M2 + c7 * CV1 + c8 * CV2 + c9

I recommend you specify all 3 covariates as predictors of all endogenous variables, so that all (in)direct effects can be consistently interpreted as "given / controlling for / holding covariates constant".  There doesn't seem to be a reason for you to label any of your covariate effects.

Terrence D. Jorgensen    (he, him, his)
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
http://www.uva.nl/profile/t.d.jorgensen


Wen L.

unread,
Nov 7, 2025, 3:45:31 AM (4 days ago) Nov 7
to lavaan
Hi Margot,

Just wanted to add a few points:

1) It's great that you're controlling for covariates! These should justifiably be pre-treatment covariates, such as baseline measurements of the mediator or outcome. (A reference is here: https://journals.sagepub.com/doi/10.1177/17456916221134573)

2) The assumed causal structures for a serial vs parallel mediation model are different. A comparison between their underlying assumptions is here: https://compass.onlinelibrary.wiley.com/doi/10.1111/spc3.12708

3) It is possible to include a covariance between M1 and M2, but you have to specify the value(s) for the model to be identified. This could be interpreted as mimicking unmeasured confounding between the mediators. An example is below.

Best wishes,
Wen Wei

--
serMedModel <- '
M1 ~ a1 * X + CV1 + CV2 + CV3
M2 ~ a2 * X + d21 * M1 + CV1 + CV2 + CV3
Y ~ cp * X + b1 * M1 + b2 * M2 + CV1 + CV2 + CV3
# specify the M1-M2 covariance 
M1 ~~ 0.3*M2
'
Reply all
Reply to author
Forward
0 new messages