我想设立一个结构方程模型(sem)的循环,用的lavvan包,但是他这样报错怎么办?
报错:Error in lavParseModelString(model) :
lavaan ERROR: left hand side (lhs) of this formula:
mydata[,i+19] ~ mydata[,i]+mydata[,i+1]
contains either a reserved word (in R) or an illegal character: “mydata[,i”“19]”
See ?reserved for a list of reserved words in R
Please use a variable name that is not a reserved word in R
and use only characters, digits, or the dot symbol.