Correlated Factors Sex limitation model
I downloaded from the OpenMX website the correlated factors sex limitation model, and amended it for our data (removing the opposite sex components as our twins are all same sex).
The script runs and converges but there is no output (seeming that it is not fitting). There are no warning messages and no error messages. The output we get is:
observed statistics: 4500
estimated parameters: 0
degrees of freedom: 4500
-2 log likelihood: NA
saturated -2 log likelihood: NA
number of observations: 750
chi-square: NA
p: NA
AIC (Mx): NA
BIC (Mx): NA
adjusted BIC:
RMSEA: NA
timestamp: 2013-11-15 09:54:40
frontend time: 9.456 secs
backend time: 0.125 secs
independent submodels time: 0 secs
wall clock time: 9.581 secs
cpu time: 9.581 secs
openmx version number: 1.0.7-1706
A number of us have looked at this, and just can't work out where the glitch is.
The data and script are attached.
Thank you so much for any assistance in advance!
Karen
Definition variable problem?
> ACENonScSLCoraFit <- mxRun(ACENonScSLCoraModel)
Running ACENonScSLCora
Error: The definition variable 'MZm.data.AgeA' in matrix 'MZm.obs_age' refers to a data set that does not contain a column with name 'AgeA'
which may be the problem.
Log in or register to post comments
In reply to Definition variable problem? by neale
Correct data set actually attached this time
I stupidly posted a copy of the data set without the Age variables. The correct data set is now attached.
I double checked this with the data I am using and all variables definitely come up, and MZm is calculating obs_age and the subsequent expected means which require it to be there.
I would really appreciate any further assistance in trying to get this model to fit.
Many thanks
Karen
Log in or register to post comments
In reply to Correct data set actually attached this time by koak
Oooh so much pain from one misplaced parenthesis
What happened was that this code
ACENonScSLCoraModel <- mxModel("ACENonScSLCora",
mxModel("ACE",
effectively made a lower level model ACE. This would be fine, except that the algebra to combine the fit functions of the mzm, dam etc. groups, was in in the ACE model, and not the top level model as required for it to be recognized as something to optimize. So the end of the script:
mxModel("DZf",
#matrix for the observed age
mxMatrix( type="Full", nrow=1, ncol=2, free=FALSE, label=c("data.AgeA", "data.AgeB"), name="obs_age" ),
#matrix for the observed Education
mxMatrix( type="Full", nrow=1, ncol=2, free=FALSE, label=c("data.EducationA", "data.EducationB"), name="obs_edu" ),
#Algebra to add covariates to mean
mxAlgebra( expression= ACE.expMeanf + ACE.b_age %x% obs_age + ACE.b_edu %x% obs_edu , name="expMeanfDZ" ),
mxData( observed=dzfData, type="raw" ),
mxFIMLObjective( covariance="ACE.expCovDZf", means="expMeanfDZ", dimnames=selVars ) ),
mxAlgebra( expression=MZm.objective + DZm.objective + MZf.objective + DZf.objective , name="modelfit" ),
mxAlgebraObjective("modelfit")
) )
needed to be modified to be:
... as before then
mxData( observed=dzfData, type="raw" ),
mxFIMLObjective( covariance="ACE.expCovDZf", means="expMeanfDZ", dimnames=selVars ) ) ),
mxAlgebra( expression=MZm.objective + DZm.objective + MZf.objective + DZf.objective , name="modelfit" ),
mxAlgebraObjective("modelfit")
#, mxCI (c('ACE.VarComp'))
)
This puts the mxAlgebra() at the end in the top level model. A similar fix would have been to skip the whole top-level model and just start with the ACE bit (and remove a parenthesis at the end).
Sorry it took me so long to figure this out. Thanks for your patience!
Log in or register to post comments
Thank you so much for going through that pain
Thank you so very, very much for subjecting yourself to all that pain for a nasty parenthesis!
I so very much appreciate it.
Karen
Log in or register to post comments
In reply to Thank you so much for going through that pain by koak
It's not you, it's us :)
Also, I note that although everything looks ok inside the fitted model (estimates, fit function etc), summary() doesn't work in the v 2.0 beta, so I'll report a bug on that front.
Log in or register to post comments