When using the lavaan package in R, I fit a CFA model:
# Load libraries:
library(dplyr)
library(lavaan)
# Create variables:
var1 <-
rnorm(10, 5, 1)
var2 <-
rnorm(10, 5, 1)
var3 <-
rnorm(10, 5, 1)
# Create dataframe:
df <-
tibble(var1, var2, var3)
# Define CFA model:
latent_var <-
"latent_var =~ var1 + var2 + var3"
# Fit CFA model, ignoring warnings:
cfa_mod <-
cfa(latent_var, df)
# Summarise, specifying standardised factor loadings:
summary(cfa_mod, standardized = TRUE)
However, when I want to plot (I've been using lavaanPlot), there seems to be no way to specify that I want the standardised loadings from the 'Std.all' column rather than the estimated loadings from the 'Estimate' column:
# Load libraries:
library(lavaanPlot)
# Plot model, specifying coefficient labels:
lavaanPlot(model = cfa_mod, coefs = TRUE)
I've played about with the 'edge_options =' argument, hoping to find some way of specifying standardised loadings, but no success (the documentation seems to suggest that this argument is aesthetic, for setting colours etc.). How can I plot the 'Std.all' column from the lavaan output instead of the 'Estimate' column, using lavaanPlot (or any other plotting package)?