Error: Illegal number of elements (3) for free matrix of lower matrix constructor

1 reply [Last post]
Tom Kubarych's picture
Offline
Joined: 10/13/2009

I am adapting the attached bivariate script to a 4-variable version. I have expanded the X, Y, and Z matrices to to 4-variables, changed Y to accomodate and AE model. After the follow part of the script:

#### DZ Model Stuff ####
mxModel("DZ",
#Pull out data and covariates for DZs
mxData(data.frame(dzData,dzDefs), type="raw" ),
mxMatrix( type="Full", nrow=1, ncol=ndef, free=FALSE, labels=c("data.age_T1","data.SITE_T1"), name="D1"), #twin1 (N)
mxMatrix( type="Full", nrow=1, ncol=ndef, free=FALSE, labels=c("data.age_T2","data.SITE_T2"), name="D2"), #twin2 (O)
mxAlgebra( expression= D1 %*% ACE.beta, name="D1R"),
mxAlgebra( expression= D2 %*% ACE.beta, name="D2R"),
# Algebra for expected Mean in DZ
mxAlgebra( expression= cbind((ACE.mu + D1R),(ACE.mu + D2R)), name="expMean"),
mxFIMLObjective( covariance="ACE.expCovDZ", means="expMean", dimnames=selVars )
),
mxAlgebra( expression=MZ.objective + DZ.objective, name="neg2sumll" ),
mxAlgebraObjective("neg2sumll")
)
I ge the following error:

Error: Illegal number of elements (3) for free matrix of lower matrix constructor

I consulted a colleague, who tells me he suspects it has to do with problems OpenMx is having with definition variables. I commented out the lines:

# mxMatrix( type="Full", nrow=1, ncol=ndef, free=FALSE, labels=c("data.age_T1","data.SITE_T1"), name="D1"), #twin1 (N)
# mxMatrix( type="Full", nrow=1, ncol=ndef, free=FALSE, labels=c("data.age_T2","data.SITE_T2"), name="D2"), #twin2 (O)
but still get the same error.

Any suggestions?

Thanks in advance for any help you can offer,

Tom

AttachmentSize
SEWB_Hip_4var_AE.R8.82 KB
sewbtwin_noicv_noNA3.txt16.69 KB
mspiegel's picture
Offline
Joined: 07/31/2009
Try using the traceback

Try using the traceback() function when you get an error. Also, it's a good idea to report any problems with definition variables to the OpenMx forums. We are not aware of any problems at this time.