[R] Question on Chi-square of null model in sem package

From: Guo Wei-Wei <wwguocn_at_gmail.com>
Date: Mon 04 Sep 2006 - 05:33:55 GMT


Dear all,

I met a problem while doing SEM by sem package. I got a negative chi-square of null model. Because the theoretical value of chi-square cannot be negative, I checked the source code of sem.R in sem package and I found the Chi-square of null model was computed by the following expression:

result$chisqNull <- (N - 1) * (sum(diag(S %*% diag(1/diag(S)))) + log(prod(diag(S))))

I think the reason for negative Chi-square is the too small value of prod(diag(S)) of my data. I'm working on a data.frame named emc.data from a sample of a 16-item questioinnaire. The variance of items are

> diag(cov(emc.data))

     EMC1 EMC2 EMC3 EMC4 EMC5 EMC6 EMC7 EMC8 0.3622224 0.2350041 0.2488009 0.2901653 0.3195399 0.3107343 0.3436622 0.2345912

     EMC9 EMC10 EMC11 EMC12 EMC13 EMC14 EMC15 EMC16 0.2621680 0.3230400 0.4039245 0.3803105 0.2773370 0.4348342 0.2757216 0.3405252

The fit indices of RMSEA and GFI are good, so I think the problem might be solve by another way for computing the Chi-square of null model. I'm not well trained in maths, so I come for help. Any advise is appreciated.

Best wishes,
Wei-Wei



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon Sep 04 16:51:32 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.