4

I'm having trouble getting rid of a path when I plot an SEM model using sempaths (package semplots). The path looks to be a covariance between two observed variables (V1_1 and V1_2).

Here is my code for both the model and output plot:

#specifying the model using lavaan package
model = '
#define latent variable 
left_right =~ Left_Right1 + Left_Right2 + Left_Right3 + Left_Right4 + 
Left_Right5
#define regression
V1_1 ~ left_right
V1_2 ~ left_right
'
#fitting an sem model
fit <- sem(model, data=data, estimator="DWLS")

#loading semplot package
library(semPlot)

#plotting path diagram
semPaths(fit,label.font = 1,label.norm = "OOOO",label.scale = T, what = 
"est", fade=FALSE,style="lisrel", rotation=4, title = FALSE, sizeLat = 9, 
sizeMan = 5, sizeMan2 =4, sizeInt = 1, sizeInt2 = 10,posCol =c("black"), 
residuals = T, layoutSplit = T, edge.label.cex = 0.6)

The output I get looks like this:

example output plot with unwanted covariance path between V1_1 and V1_2

The path/edge i'm looking to get rid of goes between nodes 'V1_1' and 'V1_2' and has a value of 0.20. Any help would be greatly appreciated.

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
TDUNN
  • 63
  • 1
  • 7

3 Answers3

1

You probably already solve this. Either way, you only need to change the "residuals" argument to FALSE.

  • 1
    This only disables residual covariances on a single item/construct. `exoCov = FALSE` will turn off covariance arrows between *exogenous* variables, but I haven't figured out how to do it between endogenous variables. – jkeirstead Apr 20 '20 at 15:19
1

From the manual: exoCov Should covariances between truly exogenous variables (no incoming directed edge) be plotted? Defaults to TRUE.

Ergo, adding exoCov = FALSE does the job.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
bathyscapher
  • 1,615
  • 1
  • 13
  • 18
0

Try:

fixedStyle = c( "white","0")
4b0
  • 21,981
  • 30
  • 95
  • 142