I wanted to do calculate the direct and all indirect effects for a path analytic model. The path diagram has been given below. I am not sure of the code to use in [R]. There are examples of simple indirect effects and mediation models using coefficients a,b,etc and then using the := symbol. But I am not sure how to use that in this slightly more complex model. Here we would have an indirect impact of V1 and V2 on V5, but no direct effect. How will that be coded? 
I wanted to do calculate the direct and all indirect effects for a path analytic model... using the := symbol. But I am not sure how to use that in this slightly more complex model. How will that be coded?
fit <- sem(mySyntax, myData)
Beta <- lavInspect(fit, "est")$beta # matrix of path coefficients
# view effects of each order
Beta # direct effects
Beta %*% Beta # indirect effects involving 2 path coefficents
Beta %*% Beta %*% Beta # indirect effects involving 3 path coefficients
Beta %*% Beta %*% Beta %*% Beta # indirect effects involving 4 path coefficients
## There are none involving 4, so there can't be any higher-order indirect effectsBeta %*% Beta + Beta %*% Beta %*% Beta # + Beta %*% Beta %*% Beta %*% Beta ... if necessary--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/YOBedJJTmzo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.