draw sem model

121 views
Skip to first unread message

hasna akub

unread,
Apr 30, 2014, 8:41:52 PM4/30/14
to lav...@googlegroups.com
I need help to draw my model.


mod2 <- 'ln.intro ~ WDI+asn.dev+ln.area+sqr.diversity
sqr.impact ~ ln.intro+WDI+asn.dev+sqr.diversity
sqr.diversity ~ ln.area
WDI ~~ asn.dev #error covariance
WDI ~~ ln.area #error covariance
asn.dev ~~ ln.area' #error covariance

#Estimation/Fitting
mod2.ests <- sem(mod2, data = light, fixed.x=FALSE)
#Extracting Results
summary(mod2.ests)

I draw it using the code:

library(semPlot)
fit <- lavaan:::cfa(mod2, data = light, std.lv = TRUE, fixed.x=FALSE)
semPaths(fit, title = FALSE, curvePivot = TRUE)

However, I have two inquiry 
1. is this the best way or there is another better way to draw? 
2. how to put the estimators values on the arrows in diagram?  

Terrence Jorgensen

unread,
May 1, 2014, 1:56:36 AM5/1/14
to lav...@googlegroups.com
These aren't lavaan questions, but perhaps I can point you in the right direction.


1. is this the best way or there is another better way to draw? 

If you want more control over exactly how you want your diagram to look, there are guides (#18 and #26) for how to create path diagrams manually in Word and in Dia (an open-source alternative to Adobe Illustrator and Microsoft Visio):

http://crmda.ku.edu/kuant-guides
 
2. how to put the estimators values on the arrows in diagram?  

The help page tells you what labels are available, using the second argument "what":

?semPlot::semPaths

For example, you can insert raw coefficients using

semPaths(fit, "est", title = FALSE, curvePivot = TRUE)

or standardized coefficients using

semPaths(fit, "std", title = FALSE, curvePivot = TRUE)

Terry
Reply all
Reply to author
Forward
0 new messages