Interpretation of chi-square goodness-of-fit

observed statistics: 2965
estimated parameters: 4
degrees of freedom: 2961
-2 log likelihood: 848.4525
saturated -2 log likelihood: 844.858
number of observations: 2266
chi-square: 3.594549
p: 1
I am a bit confused by the interpretation of the chi-squared statistic and its degrees of freedom. Before, I have seen output from classic Mx where the df for the chi-square statistic would be three for an ACE model, because it had six observed statistics (i.e. four variances and two covariances from the MZ and DZ covariance matrices) and three estimated parameters (not estimating means).
Here, the df are given as 2961 and all of the p-values for the different models round to 1, because of the very high df. This makes the chi-squared test virtually useless for assessing model fit. Am I missing something here? Is there anything else I could do?
Thankyou
Karin
Probably the wrong df
mxCompare() might be used to check this out. I suspect that you have 8 parameters in the saturated models (2 x 3 covariance parameters and 2 x 1 mean parameters), so the df for the reported chi-sq should be 4. Indeed it looks like the value of 1 is wrong and this is a bug.
Log in or register to post comments
In reply to Probably the wrong df by neale
mxCompare works
base comparison ep minus2LL df AIC diffLL diffdf p 10 844.8580 2955 -5065.142 NA NA NA
1 univTwinSat
2 univTwinSat univACE 4 848.4525 2961 -5073.547 3.594549 6 0.7313508
Looks like my df is 6....
Thankyou
Karin
Log in or register to post comments
In reply to mxCompare works by Karin
As far as I can see this is
Log in or register to post comments
In reply to As far as I can see this is by CharlesD
Fixed in revision 3536
Thanks for pointing this out. The degrees of freedom reporting was a bit confusing. The degrees of freedom reported in summary() are basically "number of observed statistics" minus "number of estimated parameters". These are not the same as the degrees of freedom for the Chi-square test, which are "number of estimated parameters in the saturated model" minus "number of estimated parameters in the fitted model", or equivalently "model degrees of freedom" minus "saturated degrees of freedom". In future versions of OpenMx, summary() will report the degrees of freedom used for the Chi-square test along side the Chi-square value to avoid this confusion.
Log in or register to post comments
In reply to Fixed in revision 3536 by mhunter
Great, looks better... but I
Log in or register to post comments
In reply to Great, looks better... but I by CharlesD
Not wrong for summary statistics
You're not thinking about it wrong, so much as OpenMx is thinking about it differently. With raw data, OpenMx counts every observation in the dataset as a statistic. The rationale for this is that it is possible to add numerous individual-level parameters to a model, moderators of paths for example, which would drive the degrees of freedom negative, despite there being plenty of information to estimate the parameters of the model. Note also that if all the observations in a column (i.e., for a variable) were missing, the traditional way of computing df would also be incorrect. Yet the model being fitted might again be perfectly reasonable to fit.
Note also that there are models other than those for means and covariances that can be specified with OpenMx, and the metric of degrees of freedom in terms of the number of observed data points is a good one to hold constant across covariance structure and other types of statistical model, since this will always be "sensical".
Log in or register to post comments
In reply to Not wrong for summary statistics by AdminNeale
Ok, sure. Then this is fine,
Log in or register to post comments
In reply to Ok, sure. Then this is fine, by CharlesD
Use mxCompare
If you want summary to work for this purpose, first check out the help page. Unfortunately, this help page is too hard to get to. Second, givesummary your saturated model. Alternatively, give summary the saturated likelihood and the saturated degrees of freedom. In code this looks like
?mxSummary
YourFittedModel # mxModel that has been run
YourSatModel # saturated mxModel that has been run
summary(YourFittedModel, SaturatedLikelihood=YourSatModel)
# Proper Chi-Square results as of svn revision 3536
# Alternative
SatLike # single number, saturated likelihood
SatDoF# single number, saturated degrees of freedom (number of observed stats minus number of estimated params)
summary(YourFittedModel, SaturatedLikelihood=SatLike, SaturatedDoF=SatDoF)
# Proper Chi-Square results whenever your saturated likelihood and degrees of freedom are correct
HTH!
Log in or register to post comments
In reply to Use mxCompare by mhunter
Thanks. Yes, the summary
Log in or register to post comments
In reply to Thanks. Yes, the summary by CharlesD
In general we don't support
Log in or register to post comments
In reply to In general we don't support by AdminHunter
This makes sense :) cheers
Log in or register to post comments