Hi Keith,
Thanks for your reply. Your suggestions would help a lot if I could make any of within- or between-level models separately. Do you know how to do it?
So my situation is like following:
#One-level model
> onelevel <- "
fw1 =~ x1 + x2 + x3 + x4
"
> result1 <- lavaan::cfa(onelevel, data = df)
> semPaths(result1, "model", "est", intercepts = FALSE) #works well
#Two-level model
> twolevel <- "
level: 1
fw1 =~ x1 + x2 + x3 + x4
level: 2
fb1 =~ x1 + x2 + x3 + x4
"
> result2 <- lavaan::cfa(twolevel, data = df)
> semPaths(result2, "model", "est", intercepts = FALSE) #returns an error
Error in object@Data@ov.names[[i]] : subscript out of bounds
Is there any way to extract each of within- and between-level model separately from the variable and run semPaths function?
Any comments appreciated. Thanks!
Daiki