Output from mxFactorScores - Order of rows?

Posted on
Picture of user. rabil Joined: 01/14/2010
In the help file for mxFactorScores, it says:

The rows are in the order of the _sorted_ data.

I'm not sure what this means. The data I have is in order by date and it's clear that the estimated factor scores for "ML" are no longer in the same order. There are two correlated factors each with 2 indicators (and nothing else). How can I get the factor scores into the same order as the rest of the data?

BTW, I'm using OpenMx 2.3.1 under R 3.2.2 (Ubuntu 15.04). mxFactorScores does not work with the RAM model so I converted it to LISREL in order to get the factor scores. (I had this problem before but I don't remember if it was ever resolved.)

Replied on Mon, 03/07/2016 - 13:37
Picture of user. tbates Joined: 07/31/2009

Hi: That's an old candidate implementation of mxFactorScores

Just update to OpenMx 2.5.2

When first drafted, mxFactorScores returned scores in the order of the sorted data. However it now returns the scores in data-order, suitable for adding as columns to your data.

It also now supports RAM.

Replied on Mon, 03/07/2016 - 15:58
Picture of user. rabil Joined: 01/14/2010

In reply to by tbates

Thanks. I upgraded to 2.5.2 and I changed the model back to RAM and I still get the same errors:

> cal.fit <- mxRun(cal.model,intervals=TRUE)
Running cal_model with 13 parameters
> fscores.ml.omx <- mxFactorScores(cal.fit,type="ML")
Error in free[i, j] : subscript out of bounds
> fscores.wml.omx <- mxFactorScores(cal.fit,type="ML")
Error in free[i, j] : subscript out of bounds

type = "Regression" does work.

I've attached the code and generated a dataset that shows these errors (at least for me).

I changed back to RAM because the LISREL version caused to mxFactorScores to generate errors.

Replied on Mon, 03/07/2016 - 22:19
Picture of user. mhunter Joined: 07/31/2009

In reply to by rabil

Sorry about this! Apparently, there's a bug in ML/WML factor scores that does not like models with confidence intervals.

When I commented out the mxCI part of the model, everything worked fine. With the mxCI()'s in there, I got the same error as you. I'll work on a bug fix, but in the meantime making the model without the confidence intervals should fix it.