I’m struggling with a confirmatory factor analysis (CFA) in R using the lavaan package. My model has 8 factors and 1 second-order factor. When I run the analysis, I get a warning about negative estimated observed variances. Here’s a simplified version of my model:
music_model <- '
fun =~ m1 + m2 + m3
relax =~ m4 + m5 + m6
emotion =~ m7 + m8 + m9
distract =~ m10 + m11 + m12
release =~ m13 + m14 + m15
work =~ m16 + m17 + m18
comfort =~ m19 + m20 + m21
immerse =~ m22 + m23 + m24
global_factor =~ fun + relax + emotion + distract + release + work + comfort + immerse
'
fit <- cfa(music_model, data=my_data, estimator='MLR', missing='FIML')
summary(fit, fit.measures=TRUE, standardized=TRUE)
My sample size is pretty small (n=78) and I’m using MLR because the data isn’t normally distributed. How can I figure out which variance is negative and fix this issue? Any tips would be really helpful!
Hey there Hugo! 
Negative variances can be such a headache, right? Especially with a small sample like yours. Have you considered trying a different estimator? Maybe WLSMV could work better for your non-normal data?
Also, I’m curious - how did you choose those 8 factors? Are they based on a specific theory or previous research? It might be worth revisiting your factor structure if the model isn’t fitting well.
Oh, and here’s a thought - have you looked at your correlation matrix? Sometimes extremely high correlations between factors can cause issues. It might give you some clues about where the problem lies.
Keep us posted on how it goes! CFA can be tricky, but it’s so satisfying when you finally get a good fit.
What’s your research about anyway? Sounds interesting!
hey hugo, that’s a tricky one! with small samples, negative variances can pop up. try checking the modification indices and standardized residuals to spot problematic items. you could also consider simplifying your model or using bayesian estimation. good luck mate!
I’ve encountered similar issues with lavaan before. Given your small sample size, the negative variance might be due to model overspecification. Consider simplifying your model structure or collapsing some factors if theoretically justifiable.
Another approach is to use a Bayesian estimator, which can handle small samples better. Try the blavaan package, which integrates with lavaan:
library(blavaan)
bfit <- bcfa(music_model, data=my_data, n.chains=3, burnin=5000, sample=10000)
summary(bfit)
This method often resolves negative variance issues. If problems persist, examine your data for outliers or multicollinearity among indicators. Remember, with complex models and small samples, interpretation should be cautious. Good luck with your analysis!