2017-06-17 58 views
2

lavaanのSEMモデルのsemPlotを使用して、異なるノードに異なるサイズを設定する方法を知りました。semPaths - Lavaan SEMの異なるサイズノード

library(lavaan) 
library(semPlot) 

model <- ' 
    # measurement model 
    ind60 =~ x1 + x2 + x3 
    dem60 =~ y1 + y2 + y3 + y4 
    dem65 =~ y5 + y6 + y7 + y8 
    # regressions 
    dem60 ~ ind60 
    dem65 ~ ind60 + dem60 
    # residual correlations 
    y1 ~~ y5 
    y2 ~~ y4 + y6 
    y3 ~~ y7 
    y4 ~~ y8 
    y6 ~~ y8 
' 
fit <- sem(model, data=PoliticalDemocracy) 

semPlotは、私は私の論文のためにこれをやったこのenter image description here

+1

は最適ではありませんが、あなたは手動でサイズを変更することができます:semPlotを割り当てる:

フルSEM分析は、ここでhttps://github.com/pachamaltese/thesis

私も私のブログのための2つの部分で完全なチュートリアルを書いている 'sの< - $ graphAttributes $ Nodes $ height [1:3] < - 8; s $ graphAttributes $ Nodes $ width [1:3] < - 8; plot(これは、 s) ' – user20650

答えて

1

をしたいと思い、

semPaths(fit, whatLabels="std", style="lisrel", exoCov = T, curvePivot = TRUE, sizeMan = 3, sizeInt = 5, 
    residuals=F) 

enter image description here

しかし与え

semPaths(fit, style="lisrel", 
     whatLabels = "std", edge.label.cex = .6, node.label.cex = .6, 
     label.prop=0.9, edge.label.color = "black", rotation = 4, 
     equalizeManifests = FALSE, optimizeLatRes = TRUE, node.width = 1.5, 
     edge.width = 0.5, shapeMan = "rectangle", shapeLat = "ellipse", 
     shapeInt = "triangle", sizeMan = 4, sizeInt = 2, sizeLat = 4, 
     curve=2, unCol = "#070b8c") 

最終的に完全に醜いしかし良い結果! http://pacha.hk/tag/structural-equation-modelling-sem.html

+0

こんにちは、あなたのコードは、この例では動作していないようです。' onefactormeasures'はどこから来ますか? – giacomo

関連する問題