# unexpected string constant error message in mxModel

I'm looking at how neuroticism ("per_neurot_y1f") predicts later change in symptoms of anxiety (from Time 1 to Time 3). I'm not sure why I'm getting this error message about this particular string of my model. Here's my code.

manifests <- c("Time1newanxiety", "Time3anxiety", "per_neurot_y1f")

latents<-"F1"

```
```

`myModelstep2<-mxModel(model="Step two", 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 = "per_neurot_y1f", to "Time1newanxiety", arrows=2, free=TRUE, values=.6, labels=c("L4")), mxPath(from = "per_neurot_y1f", to "F1", arrows = 1, free=TRUE, values = .3, labels=c("L5")),

mxPath(from = "F1", to = "F1", arrows = 2, free=TRUE, values = 1, labels=c("e1")),

mxPath(from = "Time1newanxiety", to = "Time1newanxiety", arrows=2, free=TRUE, values = .8, labels=c("e2")),

mxPath(from "per_neurot_y1f", to "per_neurot_y1f", arrows = 2, free=TRUE, values = 1, labels=c("e3")),

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")),

mxPath(from = "one", to "per_neurot_y1f", arrows = 1, free=TRUE, values = 8.83, labels=c("mneurot")),

mxData(observed=mydata3, type="raw"))

Error: unexpected string constant in "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, label"

I'm not seeing how that string is really that different from any other part of the mode. I was able to run a more simple version of this model just creating a latent difference score of change in anxiety from Time 1 to Time 3, without adding "per_neurot_y1f," so I don't understand why the same code from that old model now is a problem.

Any help would be greatly appreciated!

## reformatting

myModelstep2<-mxModel(model="Step two", 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 = "per_neurot_y1f", to "Time1newanxiety", arrows=2, free=TRUE, values=.6, labels=c("L4")),

mxPath(from = "per_neurot_y1f", to "F1", arrows = 1, free=TRUE, values = .3, labels=c("L5")),

mxPath(from = "F1", to = "F1", arrows = 2, free=TRUE, values = 1, labels=c("e1")),

mxPath(from = "Time1newanxiety", to = "Time1newanxiety", arrows=2, free=TRUE, values = .8, labels=c("e2")),

mxPath(from "per_neurot_y1f", to "per_neurot_y1f", arrows = 2, free=TRUE, values = 1, labels=c("e3")),

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")),

mxPath(from = "one", to "per_neurot_y1f", arrows = 1, free=TRUE, values = 8.83, labels=c("mneurot")),

mxData(observed=mydata3, type="raw"))

Log in or register to post comments

## =

Log in or register to post comments

In reply to = by AdminRobK

## from

Log in or register to post comments

## to

`to "Time1newanxiety"`

instead of`to="Time1newanxiety"`

Log in or register to post comments

## Thank you! Whoops that was

Log in or register to post comments