library(lavaan) library(semPlot) mat<-' 1 0.4703 1 0.4609 0.2655 1 0.2988 0.21 0.4392 1 0.2335 0.2019 0.1917 0.1462 1 0.1172 0.1262 0.0946 0.0564 0.5581 1 0.2782 0.2381 0.2747 0.2359 0.3597 0.325 1 0.1571 0.1455 0.1514 0.0942 0.3352 0.4242 0.4337 1 0.2512 0.2083 0.2517 0.2337 0.2676 0.2723 0.4076 0.3291 1 0.2684 0.2311 0.2657 0.2392 0.4099 0.4406 0.5266 0.4329 0.4761 1 0.2576 0.2123 0.2779 0.2274 0.4294 0.4382 0.5048 0.4089 0.4482 0.7457 1 0.2901 0.2464 0.2842 0.2248 0.4291 0.4812 0.4837 0.3857 0.4342 0.612 0.5634 1 0.2983 0.272 0.2919 0.2205 0.4455 0.5005 0.4592 0.3932 0.4452 0.6455 0.5574 0.845 1 0.2856 0.2136 0.3096 0.2439 0.3851 0.3966 0.4096 0.3426 0.374 0.4822 0.5176 0.6345 0.645 1 0.2521 0.1892 0.2838 0.2275 0.3525 0.343 0.3618 0.297 0.3528 0.4139 0.4674 0.5424 0.5626 0.68 1 ' wheaton.cov <- getCov(mat,names=c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12","x13","x14","x15")) model<-' F1=~x1+x2+x3+x4 F2=~x5+x6 F3=~x7+x8+x9 F4=~x10+x11 F5=~x12+x13 F6=~x14+x15 F1~~F2 F3~F1+F2 F4~F2+F3 F5~F4 F6~F5 ' fit <- lavaan:::sem(model, sample.cov=wheaton.cov, sample.nobs=2038) summary(fit, standardized=TRUE) manifests<-c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12","x13","x14","x15") latents<-c("F1","F2","F3","F4","F5","F6") labels=c("x1","x2","x3","x4","x5","x6","x7","x8","x9","x10","x11","x12","x13","x14","x15","親の\n社会経済的\n地位","本人の能力","周囲の励まし","教育的・\n職業的向上心"," 学 歴 ","職業的地位") semPaths(fit,"std",fade=F,manifests=manifests,latents=latents,nodeLabels=labels,style="lisrel")
|