I’m working on a Confirmatory Factor Analysis (CFA) in R using the lavaan package. I’ve set up my model and run the analysis, but I’m not seeing the correlations between the latent factor subscales in the output. Here’s a simplified version of what I’m doing:
library(lavaan)
model <- 'Factor =~ Sub1 + Sub2 + Sub3
Sub1 =~ Item1 + Item2 + Item3
Sub2 =~ Item4 + Item5
Sub3 =~ Item6 + Item7'
fit <- cfa(model, data = mydata, std.lv = TRUE, missing = 'fiml')
summary(fit, standardized = TRUE, fit.measures = TRUE)
parameterEstimates(fit, standardized = TRUE)
The output shows variances for the factors, but the correlations between Sub1, Sub2, and Sub3 are missing. I expected to see something like:
Sub1 ~~ Sub2 ...
Sub1 ~~ Sub3 ...
Sub2 ~~ Sub3 ...
Am I doing something wrong? How can I get these subscale correlations to show up in the output? Is there another way to find this information? Any help would be great!
I’ve encountered a similar issue when working with lavaan. The problem likely stems from how you’ve specified your model. In your current setup, Sub1, Sub2, and Sub3 are treated as indicators of the higher-order Factor, not as separate latent variables.
To get the correlations between these subscales, you need to modify your model specification. Try this approach:
model <- '
Sub1 =~ Item1 + Item2 + Item3
Sub2 =~ Item4 + Item5
Sub3 =~ Item6 + Item7
Sub1 ~~ Sub2
Sub1 ~~ Sub3
Sub2 ~~ Sub3
'
This defines Sub1, Sub2, and Sub3 as separate latent variables and explicitly specifies their correlations. Run your analysis with this model, and you should see the correlations in the output.
If you still want to include the higher-order Factor, you can add it separately in your model specification. This approach should provide the subscale correlations you’re looking for.
Hey Charlotte91! I totally get your frustration with those missing correlations.
I’ve been there too!
Have you tried adding the correlations explicitly in your model? Sometimes lavaan needs a little nudge. Maybe try something like this:
model <- 'Factor =~ Sub1 + Sub2 + Sub3
Sub1 =~ Item1 + Item2 + Item3
Sub2 =~ Item4 + Item5
Sub3 =~ Item6 + Item7
Sub1 ~~ Sub2
Sub1 ~~ Sub3
Sub2 ~~ Sub3'
This should tell lavaan to estimate those correlations for you. If that doesn’t work, have you looked at the modindices()
function? It might give you some clues about what’s going on under the hood.
I’m super curious - what kind of data are you working with? Is this for a research project or just some personal exploration? CFA can be such a rabbit hole sometimes, but it’s so rewarding when you finally crack it!
hey charlotte91, i’ve run into this too! the issue is ur model setup. try this:
model ← ’
Sub1 =~ Item1 + Item2 + Item3
Sub2 =~ Item4 + Item5
Sub3 =~ Item6 + Item7
Sub1 ~~ Sub2
Sub1 ~~ Sub3
Sub2 ~~ Sub3
’
this should give u those correlations ur looking for. lemme know if it works!