library(blavaan)
library(rjags)
library(runjags)
library(modeest)
x<-read.csv("C:/Users/Quanying LU/Desktop/5.csv")
co2.model<-'
# measurement model
co2=~y1
total=~y2+y3+y4+y5+y6
struct=~y7+y8+y9+y10
tech=~y11
# regressions
co2~total+struct+tech
total~struct+tech
struct~tech
# residual covariances
y2~~y3+y4+y5+y6+y7+y8+y9+y10+y11
y3 ~~ y4+y7
y5 ~~ y7+y8+y9
y6 ~~ y7+y8+y9+y11
y7~~y8
y8~~y11
y10~~y11'
fit <- bsem(co2.model, data=x,
dp=dpriors(nu="dnorm(5,1e-3)", itheta="dlnorm(1,.1)[sd]",
ipsi="dlnorm(1,.1)[sd]", rho="dbeta(3,3)"),
jagcontrol=list(method="rjparallel"))
summary(fit)
Compiling rjags model...
Error : The following error occured when compiling and adapting the model using rjags:
Error in rjags::jags.model(model, data = dataenv, inits = inits, n.chains = length(runjags.object$end.state), :
Error in node theta[1,1]
Invalid parent values
It may help to use failed.jags(c('model','data','inits')) to see model/data/inits syntax with line numbers
Error in blavaan(co2.model, data = x, dp = dpriors(nu = "dnorm(5,1e-3)", :
blavaan ERROR: problem with jags estimation. The jags model and data have been exported.
Quanying,
Quanying,
--
You received this message because you are subscribed to the Google Groups "blavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blavaan+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blavaan/2f3df130-2422-4027-8563-ea416bff1b8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.