Everything works just fine when I have 4 variables or more. But I thought the minimum for a CFA or EFA was 3 variables. When I run the code, it gives me 0's for all the parameters that estimate if it's a good fit or not.
For this purpose, i will use the USArrests
database.
library(lavaan)
d<- USArrests
abc <- 'abc =~ Murder + Assault + Rape'
fit <- lavaan::cfa(abc, data=d, missing = "FIML", estimator = "MLR")
summary(fit, fit.measures=TRUE)
This is where I'm running into an issue. If I add another variable to the abc
model like UrbanPop
, everything works and I will be able to get the CFI, RMSEA and so on. But sometimes I don't have a fourth one and still want to see if they're a good fit.
Results for 4 variables
Model Test User Model:
Standard Robust
Comparative Fit Index (CFI) 0.910 0.923
RMSEA 0.281 0.221
SRMR 0.073 0.073
And every time I use 3 variables regardless of the dataframe I get this :
Model Test Baseline Model:
Comparative Fit Index (CFI) 1.000 1.000
RMSEA 0.000 0.000
SRMR 0.000 0.000
Thank you!