I'm fitting a growth curve model (not latent growth curve model yet) using intercept and slope factors, and need individuals' slope and intercept estimates.
My inclination is to get factor score estimates for the intercept and slope factors, but when I do this using mxFactorScores(), I get an error message:
"Error: In model 'FactorScoresLGCM_N' the name 'fscore' is used as a free parameter in 'FactorScoresLGCM_N.Score' but as a fixed parameter in 'FactorScoresLGCM_N.Score'.
The model itself seems to run and converge without errors or warning messages.
Any advice?
I don't know what you mean by a "growth curve model" that is distinct from a "latent growth curve model".
Here is a link to a latent growth curve model script
It's easy enough to add
to this script and successfully get factor scores.
Thanks.
By "growth curve" I meant modeled change is in observed variables, not in latent variables per se; there's no measurement model in between the intercept and slope factors and the observed variables.
I wrote the code in terms of the matrix specification rather than path specification.
Interestingly, if I run the matrix growth curve model here:
https://github.com/OpenMx/OpenMx/blob/master/demo/LatentGrowthCurveModel_MatrixRaw.R
It runs, I can get the coefficients, but if I run your code above, i.e.,
I get this error:
I admit I haven't tried the path specification but I'm assuming it wouldn't be different? Or is a path specified model necessary to use
mxFactorScores()
?Ahh. It looks like you've found a bug with
mxFactorScores()
. Sorry about that! Factor scores should work in that situation (matrix spec, path spec, RAM expectation, LISREL expectation, etc.), but they are evidently broken at the moment. I'll track the problem down and write a patch shortly. The fix will be in the next release of OpenMx and available in the source version as soon as I figure it out.My first guess is that
mxFactorScores()
is getting confused by RAM expectations with matrix specification; that it's not correctly figuring out which variables are latent and which are manifest. I'll post again on this thread linking to the resolution. Again, sorry for the bug!Thanks for helping with this!
Thank you for addressing this issue! I was running into this error when trying to use the mxFactorScores() function on a matrix model. As I'm sure is the case for others, my project is currently dependent on generating these factor scores and I was wondering if you or anyone knew of alternative packages in R that could generate factor scores (specifically EAP) from a matrix model? Thanks again and looking forward to your update!
Below is a latent growth curve model in matrix form that uses the LISREL expectation. You can get factor scores from it. The bug in
mxFactorScores()
is only in the RAM matrix form. Path specification and LISREL specification both work fine.I think the EAP form of factor scores is what OpenMx calls "ML" in
?mxFactorScores
.