alishinski / lavaanPlot

R package for plotting lavaan path models with DiagrammeR
http://alexlishinski.com/lavaanPlot/
39 stars 4 forks source link

No intercept when meanstructure=TRUE #16

Open jebyrnes opened 5 years ago

jebyrnes commented 5 years ago

First off, AMAZING package. I'm working on a plot.psem package for piecewiseSEM and am drawing some inspiration here (which, unrelated, any luck on moving coefficients to where you want them instead of overlapping paths sometimes?)

Anyway, my question is, when I use meanstructure=TRUE, I'm expecting an intercept - traditionally a 1 in a triangle. But, instead, I get nothing. Here's a reprex.

library(lavaan)
library(lavaanPlot)

d <- data.frame(x = rnorm(100))
d$y <- rnorm(100, d$x, 5)

fit <- sem('y ~ x',  data = d, meanstructure=T)

lavaanPlot(model = fit, coefs=T)

image

No intercept.

jebyrnes commented 5 years ago

(also note how close the coef is to the arrow - really want to find a way to fix that)