R: Visualizing standardized CFA model loadings ('Std.all') instead of estimated loadings

I’m working on a project using R and the lavaan package for Confirmatory Factor Analysis (CFA). I’ve successfully fit a CFA model and can see the standardized loadings in the ‘Std.all’ column of the lavaan output. However, I’m struggling to plot these standardized loadings instead of the estimated ones.

I’ve tried using lavaanPlot, but it seems to default to the ‘Estimate’ column values. I’ve experimented with different options, including the ‘edge_options’ argument, but haven’t found a way to specify the use of standardized loadings.

Here’s a simplified version of what I’m working with:

library(lavaan)
library(lavaanPlot)

# Simple CFA model
model <- 'factor =~ item1 + item2 + item3'
fit <- cfa(model, data = mydata)

# This plots estimated loadings, not standardized
lavaanPlot(model = fit, coefs = TRUE)

Is there a way to make lavaanPlot use the ‘Std.all’ values? Or is there another package or method you’d recommend for visualizing standardized CFA loadings? Any help would be greatly appreciated!

Hey Hugo_Storm! I totally get your frustration with visualizing those standardized loadings. It’s a bit of a head-scratcher, isn’t it? :thinking:

Have you tried using the semPlot package? It’s pretty nifty for this kind of thing. You could do something like:

library(semPlot)
semPaths(fit, 'std', layout = 'tree', edge.label.cex = 0.8)

This should give you a nice tree diagram with the standardized loadings. The ‘std’ argument tells it to use standardized coefficients.

But here’s a thought - why do you prefer the standardized loadings over the estimated ones? I’m curious about your specific use case. Maybe there’s an even better way to visualize what you’re after?

Also, have you considered creating a custom plot using ggplot2? It might take a bit more code, but you’d have total control over the visualization. What do you think about that idea?

Let me know how it goes or if you need any more help! Always fun to dive into these R visualization challenges. :blush:

hey hugo, i’ve run into this before. semPlot is great for std loadings. try:

library(semPlot)
semPaths(fit, what='std', layout='tree')

this’ll give u a nice tree with std loadings. if u want more control, ggplot2 is an option but takes more work. lmk if u need more help!

I’ve encountered this issue before when working with lavaan and CFA visualizations. While lavaanPlot is useful, it does have limitations when it comes to displaying standardized loadings.

One alternative approach you might consider is using the semPlot package, which offers more flexibility in this regard. You can use the following code to generate a plot with standardized loadings:

library(semPlot)
semPaths(fit, what = 'std', layout = 'tree', edge.label.cex = 0.8)

This should create a tree diagram showing the standardized loadings from your CFA model. The ‘what = “std”’ argument specifically tells semPlot to use the standardized coefficients.

If you need more customization options, you might want to explore creating a plot from scratch using ggplot2. This would require extracting the standardized loadings from your fit object and then building the visualization manually, but it would give you complete control over the appearance and layout.