SachaEpskamp / semPlot

Path diagrams and visual analysis of various SEM packages' output
GNU General Public License v2.0
61 stars 20 forks source link

Possible to omits paths fixed to 0 from plots? #29

Open stephanoplis opened 4 years ago

stephanoplis commented 4 years ago

Hi, I'm currently trying to plot a CFA in which an Acquiescence factor is modeled across three correlated substantive dimensions. I've set the Acquiescence and substantive factors to be uncorrelated and would like to omit these paths, but not the correlations between the substantive factors, from the plot. Is there a way to do this? I've copied code for the model and plot below.

Model: multi2acq_mod <- 'system =~ EPO7 + EPO10; antisusp =~ EPO1R + EPO2R + EPO3R + EPO4R + EPO6R + EPO8 + EPO11; prevent =~ EPO5R + EPO9; acq =~ a*EPO1R + a*EPO2R + a*EPO3R + a*EPO4R + a*EPO5R + a*EPO6R + a*EPO7 + a*EPO8 + a*EPO9 + a*EPO10 + a*EPO11; acq ~~ 0*system + 0*antisusp + 0*prevent'

Plot: layout <- matrix(c(0.8,1,seq(-1.15,0.05,.2),.4,.6,0.9,-0.5,0.5,0, 0,0,0,0,0,0,0,0,0,0,0,2,2,2,-3), ncol=2,nrow=15,byrow=FALSE) labs <- c(paste0("item",c(7,10,1,2,3,4,6,8,11,5,9)),"System","Anti-Sus-\npension","Pre-\nvention","Acqui-\nescence") semPaths(multi2acq_cfa,layout=layout,what="path",style="lisrel", whatLabels="no",edge.color="black",residScale=5, fixedStyle=c("black","solid"),freeStyle=c("black","solid"), nodeLabels=labs)

And here is the figure it produces: image