Dear List,
I'm trying to fit a null hierarchical multivariate model in WinBUGS. I use rube package in R in order to run my model. Tje mdel code is as below:
model{
#responses
for(i in 1:N){
for(j in 1:K){
logit(p[i,j])<- a1[j]*t[i,1]+a2[j]*t[i,2]-b[j]
y[i,j]~dbern(p[i,j])
}#for j
t[i,1:2]~dmnorm(mu[sc[i],1:2],tau.p[1:2,1:2])
}#for i
#school level
for(j in 1:J){
mu[j,1:2]~dmnorm(mu0[1:2],tau.s1[1:2,1:2])
}#for j of school
#priors
tau.p[1:2,1:2]~dwish(covp[1:2,1:2],3)
tau.s1[1:2,1:2]~dwish(covp[1:2,1:2],3)
sigma.p[1:2,1:2]<-inverse(tau.p[,])
sigma.s1[1:2,1:2]<-inverse(tau.s1[,])
sigmap<-sum(sigma.p[,])
sigmas<-sum(sigma.s1[,])
rho<-(sigmas)/(sigmas+sigmap)
a1[1]~dlnorm(0,2)
a2[1]<-0
b[1]~dnorm(0,1)
for(s in 2:K) {
a1[s]~dlnorm(0,2)
a2[s]~dlnorm(0,2)
b[s]~dnorm(0,1)
}#for s of items
}#for model
This is a multidimensional IRT model for K=45 dichotomous items answered by N=2362 students nested within J=116 schools.I use this function for generating initial values:
ini<-function(){
list(tau.p=matrix(c(rgamma(1,100,100),0,0,rgamma(1,100,100)),2,2),tau.s1=matrix(c(rgamma(1,100,100),0,0,
rgamma(1,100,100)),2,2),
t=rmvnorm(2362,c(0,0),diag(2)),mus=rmvnorm(116,c(0,0),diag(2)),
a1=rlnorm(45,0,0.3),a2=c(NA,rlnorm(44,0,0.3)),b=rnorm(45,0,0.5))}
Would you please help to figure out the source of error message? I'm a newbie in WinBUGS and it would be much more appreciated if you introduce me some references as well to tackel this kind of traps in WinBUGS.
Thanks,
Amin.
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|