Multilevel Moderated Mediation with binary DV

77 views
Skip to first unread message

Bernard Fernou

unread,
Sep 11, 2019, 9:43:44 AM9/11/19
to lavaan
Hi, 

I would like to perform a multilevel moderated mediation using lavaan. However, my dependent variable is binary. I understand that lavaan does not handle (yet) multilevel SEM with binary DV, so I tried to avoid the problem by using packages that could help lavaan to perform such analyses. I found the interesting lavaan.survey package. 
My approach was then to estimate a single-level SEM in lavaan (as lavaan accepts binary outcome for single level models) and then to account for clustering using lavaan.survey. However, I constantly received an error, which occurs because - I believe - lavaan.survey does not handle binary outcome too. 
This is the error: "Error in Dplus %*% Gamma.cov.g : non-conformable arguments" and this is my code: 

 

M1 <-'

M ~ a1*X + a2*W + a3*M:W

Y ~ cd1*X + cd2*W + cd3*X:W + b1*M

              IndexofModMed := a3*b1

              '

SEM.1 <- sem(model = M1, data, estimator="MLR")


clustering<-svydesign(ids=~ID, weights = ~1, data)


SEM.1.Adjusted<-lavaan.survey(SEM.1, survey.design=clustering, estimator= "MLM")



Is there a way to estimate this model using lavaan, or a package that can assist it? If not, is it possible in R using an other package? 


Thanks!


BF

Terrence Jorgensen

unread,
Sep 13, 2019, 10:11:58 AM9/13/19
to lavaan
my dependent variable is binary. I understand that lavaan does not handle (yet) multilevel SEM with binary DV

Correct
 
I believe - lavaan.survey does not handle binary outcome too. 

Correct
 

Is there a way to estimate this model using lavaan


Not currently.

is it possible in R using an other package? 


Try the mediation package (which uses robust bootstrap algorithms) or the recent implementation of Andy Hayes' PROCESS macro in R: processR

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Bernard Fernou

unread,
Sep 15, 2019, 5:20:18 AM9/15/19
to lavaan
I thought that the mediation package could handle multilevel mediation but not multilevel moderated mediation. I will read more on that.

Thank you very much for your answer!

Terrence Jorgensen

unread,
Sep 16, 2019, 9:16:51 AM9/16/19
to lavaan
I thought that the mediation package could handle multilevel mediation but not multilevel moderated mediation. I will read more on that.

You fit each outcome's model separately, so you just include whatever interaction terms are relevant for each outcome/mediator.

Terrence D. Jorgensen

Assistant Professor, Methods and Statistics

Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages