Serial mediation model - adjusting for covariance and covariates

29 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


Reply all
Reply to author
Forward
0 new messages