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.)
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.
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.
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.
Here's the issue.
It will be fixed in the next release: http://openmx.psyc.virginia.edu/issue/2016/03/confidence-interval-reference-search-broken
Thanks. I commented out the mxCI argument and it works.