Hi all,
I'm doing a confirmatory factor analysis on a dataset with 405 observations of 40 variables.
I'd like to be able to compare models that make use of more or fewer of these variables, e.g.:
model1 <- 'F1 =~ A + B + C + D + E + F + G + H + I + J + K'
model2 <- 'F1 =~ A + B + C + D + E + F
F2 =~ G + H + I + J + K'
model3 <- 'F1 =~ A + B + C + D
F2 =~ E + F + G
F3 =~ H + I + J + K'
model4 <- 'F1 =~ A + B + D
F2 =~ E + G
F3 =~ I + J + K'
In reality, model1 has one factor that uses all 40 items; model2 has 2 factors that use all 40 items between them; model3 has 3 factors that use all 40 items between them; and model4 has 3 factors that use only 16 items between them.
When I compare only model1, model2, and model3 (using anova(model1, model2, model3, model4)), I find that model1 fits significantly worse than model3, which is not significantly worse than model2. So, so far, looks like model3 is the way to go.
When I add model4, it looks like the best-fitting previous model is significantly worse-fitting than model4. This would make sense to me, but I'm worried about an error that this command throws:
> anova(d1_all_fit1, d1_all_fit2, d1_all_fit3, d1_all_fit4)
Chi Square Difference Test
Df AIC BIC Chisq Chisq diff Df diff Pr(>Chisq)
d1_all_fit4 101 23230 23370 619.03
d1_all_fit2 734 56251 56595 5966.77 5347.7 633 <2e-16 ***
d1_all_fit3 737 55341 55673 5062.83 -903.9 3 1
d1_all_fit1 740 56681 57002 6409.26 1346.4 3 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Warning message:
In lavTestLRT(object = <S4 object of class "lavaan">, SB.classic = TRUE, :
lavaan WARNING: some models are based on a different set of observed variables
I assume that this warning comes from the fact that model4 makes use of only 16 of the 40 observed variables, when the other models make use of all 40.
How big of a problem is this? Are these models impossible to compare? E.g., is there something about a simpler model (using fewer observed variables) that will mathematically make it a better fit? (My intuition is that the reverse would be true, if anything!)
Thanks so much for your help! Happy to post more of my actual input/output if that would be helpful.
Best wishes,
Kara