Copyright © 2007-2024 The OpenMx Project
Hi Michael
Let's try to get df correct in OpenMx. We thought this was a priority at the meeting yesterday. There are one or two things to consider, however, when it comes to raw data input because the statistics are not counted the same way in every software package.
In general, df = nstats - nparameters
Suppose there are i=1...ng groups (submodels) in the model. Let the number of variables in submodel i be m_i. Let the number of nonlinear equality constraints be nk. Then, for only covariance matrix input we have:
nstats(cov)= sum_i {m_i(m_i + 1)/2} + nk
if means are also input then
nstats(cov+mean)= sum_i {m_i(m_i + 2)/2} + nk
if a correlation matrix was input then
nstats(cor)= sum_i {m_i*(m_i - 1)/2} + nk
Mx version 1 uses the total number of raw data observations. If there are m_ij variables observed in the j=1...n subjects in submodel i, then
nstats(raw) = sum_i sum_j {m_ij} + nk
This is suitable for both raw continuous and raw ordinal. For certain purposes, we might use nstats(cov+mean) in place of nstats(raw) as some other programs use this. The disadvantage is that it is possible to end up with negative degrees of freedom if there are definition variables and parameters relating the definition variables to the observed variables in the model.
For the time being, let's just make OpenMx agree with ShutMx.
Cheers
Mike