1

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.

Vitali Avagyan
  • 1,193
  • 1
  • 7
  • 17
Deep Learning
  • 21
  • 1
  • 4
  • 1
    Can you provide a bit more context or an example? – stevec Nov 23 '19 at 13:51
  • 1
    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 bias of the WE effect as a mediator. – Deep Learning Nov 23 '19 at 14:08
  • 2
    This will help you: https://paolotoffanin.wordpress.com/2017/05/06/multiple-mediator-analysis-with-lavaan/comment-page-1/ Pay attention to discussions at the bottom of the article. Hope, this helps. – Vitali Avagyan Nov 23 '19 at 16:01
  • Yes, this answered my question, thank you! – Deep Learning Nov 23 '19 at 17:18
  • This is an old question that has been resolved, but I thought I would add this to the answer if anyone else comes across this question. On the lavaan website there is an explenation on how to control for a variable, e.g. gender. https://lavaan.ugent.be/tutorial/cat.html – Helgi Guðmundsson Jun 01 '21 at 14:44

0 Answers0