I was wondering if there is a function to add control variables when doing SEM in lavaan
conveniently in R?
I would like to test the mediation effect of WE
between OSE
and IWB
. However, if there is another variable Z
(e.g. age
or gender
) that correlates with WE
and IWB
, it creates a link - thus, creating correlation between the WE
and IWB
. I believe I would need to control for it in order to avoid the bias of the WE
effect as a mediator.