I’m working with R and the lavaan package to run a Confirmatory Factor Analysis (CFA). I’ve successfully fit the model and can see the standardized loadings in the ‘Std.all’ column of the output. But I’m stuck when it comes to plotting these standardized values.
I’ve tried using lavaanPlot, but it seems to only plot the estimated loadings by default. I’ve looked through the function arguments, especially ‘edge_options’, but can’t figure out how to make it show the standardized loadings instead.
Here’s a simplified version of what I’m doing:
library(lavaan)
library(lavaanPlot)
# Define and fit model
model <- 'factor =~ item1 + item2 + item3'
fit <- cfa(model, data = my_data)
# This shows standardized loadings in output
summary(fit, standardized = TRUE)
# But this plot shows estimated loadings
lavaanPlot(model = fit, coefs = TRUE)
Is there a way to make lavaanPlot use the ‘Std.all’ values? Or is there another package that can easily plot these standardized loadings from a lavaan CFA model? Any help would be appreciated!
I’ve encountered this issue before, and I found a workaround using the semPlot package. It’s quite versatile for visualizing SEM and CFA models, including standardized factor loadings.
Here’s what worked for me:
library(semPlot)
semPaths(fit, 'std', layout = 'tree', edge.label.cex = 0.8)
This creates a path diagram with standardized coefficients. You can adjust the ‘layout’ and ‘edge.label.cex’ parameters to suit your needs.
If you prefer something more customizable, you might want to extract the standardized loadings manually and use ggplot2. It’s a bit more work, but gives you full control over the visualization:
std_loadings <- standardizedSolution(fit)
# Then use ggplot2 to create a custom plot
Hope this helps! Let me know if you need more details on either approach.
hey surfingwave, have u tried the semplot package? it’s pretty cool for this kinda stuff. just do:
library(semPlot)
semPaths(fit, what='std', layout='tree')
this should give u a nice diagram with standardized loadings. play around with the layout if u want. hope this helps! lemme know if u need anything else 
Hey there, fellow R enthusiast! 
I totally get your frustration with visualizing those standardized loadings. Been there, done that! Have you considered giving the ‘semTools’ package a whirl? It’s got some nifty functions that might be just what you’re looking for.
Try this on for size:
library(semTools)
# Assuming 'fit' is your lavaan model
plotLoadings(fit, cutoff = 0.3)
This bad boy should give you a heat map of your standardized factor loadings. You can play around with the ‘cutoff’ value to highlight the stronger loadings.
Or if you’re feeling a bit more adventurous, why not roll up your sleeves and craft your own plot with ggplot2? It’s a bit more work, but you get to be the boss of how everything looks!
library(tidyverse)
library(lavaan)
std_loadings <- standardizedSolution(fit) %>%
filter(op == '=~')
ggplot(std_loadings, aes(x = rhs, y = est.std)) +
geom_col() +
coord_flip() +
labs(x = 'Items', y = 'Standardized Loadings')
What do you think? Does either of these tickle your fancy? Let me know if you want to brainstorm more ideas!