Attachment | Size |
---|---|

twinAceOrdAgeSex_Script.R | 7.21 KB |

Hi,

I ran the attached ordinal ACE script with age and sex as covariates, and I noticed that for some of my variables I would get the following error message:

"Error in runHelper(model, frontendStart, intervals, silent, suppressWarnings, :

SLSQP: Failed due to singular matrix E or C in LSQ subproblem or rank-deficient equality constraint subproblem or positive directional derivative in line search "

I'm not quite sure what the error message mean and what I should change, but I did notice that when I only included sex as covariate, the code would be able to run properly. Does it mean something went wrong when I included age as one of the covariates?

Any help will be appreciated! Thank you very much!

First, I guess you should double-check to make sure nothing weird is going on with the age variable in your dataset. Also, if age is measured in years, you could try dividing it by 100 to put it in centuries. That might seem weird, but it could help with the numerical stability of the optimization problem.

It's generally a good idea to use start values that satisfy any MxConstraints. You have the total variance constrained equal to 1.0. Your start values for

`a11`

,`c11`

, and`e11`

come close to satisfying the constraint, but not exactly. You could try starting`e11`

at 1 and the other two at zero, for instance.If you include age but run the MxModel with

`intervals=FALSE`

, does it work? If so, then you know that whatever's going wrong is happening while CIs are being calculated.You could try switching optimizers. If you installed OpenMx from the virginia.edu repository, you can switch from SLSQP to NPSOL with

`mxOption(NULL,"Default optimizer","NPSOL")`

. A similar command can switch to CSOLNP.Thanks Rob, your suggestions were really helpful - the problem indeed disappeared after I divided age by 100. By the way, just wondering if there's any requirement for the distribution to be normal for ordinal ACE? My feeling is that it doesn't make much sense to transform ordinal data such as Likert-type scales?

With ordinal data, the assumption is that the ordinal variables represent a latent multivariate normal continuum that has been "cut" at the thresholds to create the observed ordinal data. So no, there's no need to transform variables you are going to treat as ordinal.

You might also check whether you have an redundant equality constraints. This kind of error will show up if the jacobian of the constraints is rank deficient.