Hello,
I'm using OpenMx for the first time, building a model in 4 steps. I'm having trouble running the first step that just involves creating a latent difference score using the McArdle (2008) approach. I just have two manifest variables taken at two time points, Anxiety at Time 1 and Anxiety at Time3, and I want to make a latent difference score of these two. Creating the model is not a problem and results in no error message. However, when I actually run the model, I get an error message. Here is the code I've been using and the error message I keep getting:
manifests<-names(mydata3)
latents<-"F1"
myModel5<-mxModel(model="LatenceDifferenceScoreAnxiety", type="RAM", manifestVars=manifests, latentVars=latents,
mxPath(from="Time1newanxiety", to="Time3anxiety", arrows=1, free=FALSE, values=1, labels=c("L1")),
mxPath(from = "F1", to = "Time3anxiety", arrows=1, free=FALSE , values=1, labels=c("L2")),
mxPath(from ="Time1newanxiety", to = "F1", arrows = 2, free=TRUE, values = .4, labels=c("L3")),
mxPath(from = "F1", to = "F1", arrows = 2, free=FALSE, values = 1),
mxPath(from = "Time1newanxiety", to = "Time1newanxiety", arrows=2, free=TRUE, values = .8, labels=c("e1")),
mxPath(from = "one", to = "Time1newanxiety", arrows=1, free=TRUE, values = 7.36, labels=c("manxiety1")),
mxPath(from = "one", to = "F1", arrows=1, free=TRUE, values = .1, labels=c("mchangeanxiety")),
mxData(observed=mydata3, type="raw"))
myModel5Run<-mxRun(myModel5)
"Error: The job for model 'LatenceDifferenceScoreAnxiety' exited abnormally with the error message: fit is not finite (0: The continuous part of the model implied covariance (loc2) is not positive definite in data 'LatenceDifferenceScoreAnxiety.data' row 240. Detail:
covariance = matrix(c( # 30x30 "
Then it lists a ton of zeros, then this:
"In addition: Warning message:
In model 'LatenceDifferenceScoreAnxiety' Optimizer returned a non-zero status code 10. Starting values are not feasible. Consider mxTryHard() "
I tried a lot of things to try to address the problem, including fiddling with the free values, and running mxTryHard. That resulted in another error message: " All fit attempts resulted in errors - check starting values or model specification. "
I then looked for a better way to change the values, so I used: mxGetExpected(myModel5, 'covariance'). However, this only gave me what I had already put in for the variance in Time1new anxiety (.8) and did not give me covariances for F1 and any of my manifest variables.
I used mxAutoStart(myModel5, type = c("ULS”)) to find better values. I got this error message: "Error in omxSetParameters(myModel5, values = newparams, labels = names(oldparams)) :
'labels' argument must be a character vector. "
I used mxAutoStart(myModel5, type = c("DWLS")) to find better values. I got this error message: "Error in optimize(logLikFUN, lower = pcBounds[1], upper = pcBounds[2], :
'xmin' not less than 'xmax'. "
If anyone has any ideas of what might be the problem, I would greatly appreciate it!
Thank you!!!