Can I do Multilevel SEM in JASP?
Hello,
I was wondering if I can do Multilevel SEM in JASP like this: http://lavaan.ugent.be/tutorial/multilevel.html
I searched the forum and elsewhere and couldn't find an answer to this. I downloaded the demo data from lavaan, loaded it into JASP and tried to adapt the lavaan code but it didn't run. It said "Variables(s) in model syntax not recognized: level, 1, 2":
I thought before I quit trying I should just check with ya'll. Maybe it is possible and I've just made a typo or missed a check-box somewhere.
It would be great if this does work. But if it doesn't it would be nice to know so I can stop trying ?
Thanks for your help either way.
-Josh
Comments
I'll pass this on to our lavaan expert!
Hi, @Joshh.
I think that at the moment with the SEM module of jasp it is not possible to do the multilevel, because there is no option to set the cluster argument with the variable of interest.
Your reference to the Demo.twolevel dataframe, has a cluster variable to pass to the cluster argument of the lavaan :: sem function
In RStudio:
model <- '
level: 1
fw = ~ y1 + y2 + y3
fw ~ x1 + x2 + x3
level: 2
fb = ~ y1 + y2 + y3
fb ~ w1 + w2
'
fit <- lavaan::sem(model = model, data = Demo.twolevel, cluster = "cluster")
summary(fit)
Cheers,
Maurizio
Hi josh,
@MAgoJ is completely right! At this moment, this is not possible in JASP. In the future, we will probably enable this functionality. Keep an eye on JASP :)
Erik-Jan