mateo zelug
2013-Apr-28 16:47 UTC
[R] hierarchical confirmatory factor analysis with sem package
Hi, I am doing a hierarchical CFA using the sem package. I have 20 items, and I have 2 factors (F3 and F4), and also F1 and F2 are nested within F3. Here is the code that I have, but it is giving me an error message "Warning message: In eval(expr, envir, enclos) : Negative parameter variances. Model may be underidentified." and a further error "Error in summary.objectiveML(cfa, fit.indices = c("NNFI", "CFI", "RMSEA")) : coefficient covariances cannot be computed". I have run CFA before with no issues. This is the first time I am running a nested model. Any help will be greatly appreciated. Regards, Mat cov.matrix<-cov(na.omit(df)) cfa.model<-specifyModel() F1->i2,a1 F1->i3,a2 F1->i4,a3 F1->i11,a4 F1->i12,a5 F1->i15,a6 F1->i18,a7 F2->i6,b1 F2->i7,b2 F2->i8,b3 F2->i13,b4 F2->i20,b5 F3->F1,c1 F3->F2,c2 F4->i1,d1 F4->i5,d2 F4->i9,d3 F4->i10,d4 F4->i14,d5 F4->i16,d6 F4->i17,d7 F4->i19,d8 F1<->F1,NA,1 F2<->F2,NA,1 F3<->F3,NA,1 F4<->F4,NA,1 i2<->i2,error1 i4<->i4,error2 i6<->i6,error3 i7<->i7,error4 i8<->i8,error5 i11<->i11,error6 i13<->i13,error7 i15<->i15,error8 i18<->i18,error9 i20<->i20,error10 i1<->i1,error11 i3<->i3,error12 i5<->i5,error13 i9<->i9,error14 i10<->i10,error15 i12<->i12,error16 i14<->i14,error17 i16<->i16,error18 i17<->i17,error19 i19<->i19,error20 cfa<-sem(cfa.model,cov.matrix,nrow(df)) summary(cfa,fit.indices=c("NNFI","CFI","RMSEA")) [[alternative HTML version deleted]]