SachaEpskamp / semPlot

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

Single indicators #32

Closed HanZhang-psych closed 3 years ago

HanZhang-psych commented 3 years ago

Hello!

I wonder if there is a way to selectively show a single indicator in the structural part of the model while hiding the measurement part. Here is an example:

library(lavaan)
library(semPlot)
model <- "
  lv1 =~ mpg + cyl + wt
  lv2 =~ am + vs + gear
  drat ~ lv1
  lv2 ~ drat

"
fit <- sem(model, data = mtcars)
semPaths(fit)

image

I'd like to hide the manifest variables but keep drat in the plot. Using structural=T would remove drat from the plot.

image

Thank you! Han

SachaEpskamp commented 3 years ago

Hi Han,

This is not possible at the moment, but you could represent DRT with a latent variable in the lavaan model for an equivalent setup.

Best, Sacha