visibility in lavaanPlot function

509 views
Skip to first unread message

Md. Shahin

unread,
Mar 18, 2022, 1:23:20 AM3/18/22
to lavaan
Hi 
I want to increase the size of the plot in lavaanPlot(). But used the following code. There is no change in the shape of the plot. 

lavaanPlot(model = fit3,
           graph_options = list(overlap = "TRUE", fontsize = "15"),
           node_options = list(shape = "box", fontname = "Helvetica"),
           edge_options = list(color = "blue"),
           coefs = TRUE,
           stand = F,
           #covs= TRUE
           sig = 0.10,
           stars = "regress"


All the independent variables are shown in one row and a dependent variable is plotted down the independent variables. I warmly welcome your suggestions. 

Shu Fai Cheung

unread,
Mar 18, 2022, 3:13:35 AM3/18/22
to lavaan
I am not familiar with DiagrammeR but I would like to try. Can adding the width and height arguments to node_options achieve what you want?

library(lavaan)
HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '

fit <- cfa(HS.model, data = HolzingerSwineford1939)

library(lavaanPlot)
lavaanPlot(model = fit,

           graph_options = list(overlap = "TRUE", fontsize = "15"),
           node_options = list(shape = "box", fontname = "Helvetica",
                                            width = 1.5,
                                            height = 1),

           edge_options = list(color = "blue"),
           coefs = TRUE,
           stand = F,
           #covs= TRUE
           sig = 0.10,
           stars = "regress"

temp1.png

lavaanPlot(model = fit,

           graph_options = list(overlap = "TRUE", fontsize = "15"),
           node_options = list(shape = "box", fontname = "Helvetica",
                                            width = 1,
                                            height = 1),

           edge_options = list(color = "blue"),
           coefs = TRUE,
           stand = F,
           #covs= TRUE
           sig = 0.10,
           stars = "regress"
)


temp2.png

-- Shu Fai
Reply all
Reply to author
Forward
0 new messages