sfcheung/semptools

set_cfa_layout()

sms2021 opened this issue · 4 comments

set_cfa_layout() does not work with Lisrel style . In addition, it does not accept the indicator_push and ,l indicator_spread.

  • Sorry for my oversight. semptools dose not officially support the Lisrel style, and we have no plan to support this style in the near future. I will add a remark to the documentation later.

  • For your second part on indicator_push and indicator_spread, may you post a reproducible example so I can take a look? Thanks a lot.

Thank you for quick response Mr. Shu Fai Cheung. Here is an example:

library(lavaan)
library(semPlot)
library(semptools)

mod <-
'f1 =~ x01 + x02 + x03
f2 =~ x04 + x05 + x06 + x07
f3 =~ x08 + x09 + x10
f4 =~ x11 + x12 + x13 + x14
'
fit_cfa <- lavaan::sem(mod, cfa_example)

lavaan::parameterEstimates(fit_cfa)[, c("lhs", "op", "rhs", "est", "pvalue")]

p <- semPaths(fit_cfa, whatLabels="est",
sizeMan = 5,
nCharNodes = 0, nCharEdges = 0,
edge.width = 0.8, node.width = 0.7,
edge.label.cex = 0.6,
style = "ram",
mar = c(10,10,10,10))

indicator_order <- c("x04", "x05", "x06", "x07", "x01", "x02", "x03", "x11",
"x12", "x13", "x14", "x08", "x09", "x10")
indicator_factor <- c( "f2", "f2", "f2", "f2", "f1", "f1", "f1", "f4",
"f4", "f4", "f4", "f3", "f3", "f3")
indicator_push <- c(f1 = 2,
f2 = 2,
f3 = 2,
f4 = 2)
indicator_spread <- c(f1 = 2,
f2 = 2,
f3 = 2,
f4 = 2)

p2 <- set_cfa_layout(p, indicator_order,
indicator_factor,
indicator_push,
point_to = "down",
fcov_curve = 1.5,
loading_position = .8)
plot(p2)

Thanks for the example. Note that set_sem_layout() and set_cfa_layout() do not have identical set of arguments. `

https://sfcheung.github.io/semptools/reference/set_cfa_layout.html
https://sfcheung.github.io/semptools/reference/set_sem_layout.html

set_cfa_layout() does not have the indicator_push and indicator_spread arguments. For CFA, it is not necessary to "push" or "spread" the indicators.

Hope this helps.

  • Sorry for my oversight. semptools dose not officially support the Lisrel style, and we have no plan to support this style in the near future. I will add a remark to the documentation later.

I checked and most functions can support the LISREL-style plot. The function set_cfa_layout() has been updated to supported a LISREL-style plot. I am closing this issue. A new issue will be opened if incompatibility with LISREL-style plot was found.