library(lavaan) library(semPlot) mat<-' 1 0.57 1 0.48 0.59 1 0.3 0.3 0.32 1 0.15 0.29 0.3 0.29 1 0.29 0.41 0.35 0.42 0.44 1 0.18 0.33 0.3 0.49 0.46 0.63 1 0.38 0.42 0.37 0.51 0.3 0.45 0.56 1 0.33 0.28 0.3 0.52 0.36 0.37 0.56 0.63 1 0.29 0.36 0.29 0.37 0.21 0.31 0.24 0.28 0.22 1 0.2 0.39 0.29 0.34 0.18 0.39 0.29 0.23 0.24 0.51 1 0.17 0.21 0.15 0.31 0.37 0.29 0.4 0.29 0.4 0.2 0.28 1 ' wheaton.cov <- getCov(mat,names=c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12")) sd<-c(0.78, 1.32, 0.83, 1.01, 1.55, 1.36, 1.09, 1.28, 0.7, 0.73, 1.29,1.17) full.cov <- lavaan:::cor2cov(wheaton.cov,sd,names=c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12")) model1<-' F1=~x1+x2+x3 F2=~x4 F3=~x5+x6+x7 F4=~x8+x9 F5=~x10+x11 F6=~x12 F1~~F2 F1~~F3 F2~~F3 F4~F1+F2+F3 F5~F1+F2+F4 F6~F4+F5 x4~~0.06*x4 x12~~0.43*x12 ' fit <- lavaan:::sem(model1, sample.cov=full.cov, sample.nobs=151) summary(fit, standardized=TRUE) manifests<-c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12") latents<-c("F1","F2","F3","F4","F5","F6") labels=c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12", "セールスマン\nと顧客の類\n似性","セールスマン\nの専門性","関係を拡げる\nための努力","セールスマン\nと顧客の関係\nの質","これまでの\nセールスの\n実績","将来の継続的\n取引の意志") svg("graph.svg", family="Takao P明朝", width=12, height=10) semPaths(fit,"std",fade=F,manifests=manifests,latents=latents,nodeLabels=labels,style="lisrel",gray=T, edge.label.cex=0.7,esize=TRUE,fixedStyle=c("black",1), freeStyle=c("black",1),layout="tree2") dev.off()
|