Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omit covariance path in sempaths (package: semplot)

Tags:

r

r-lavaan

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.

like image 350
TDUNN Avatar asked Oct 17 '25 10:10

TDUNN


1 Answers

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

like image 54
pablo salazar Avatar answered Oct 19 '25 00:10

pablo salazar