Dear Bugs users,
I'd like to run a random effects model for multi-arms trials. I have
difficulties to load the initial values for the deltas. Model is as follows :
model {
for (i in 1:ns) {
w[i,1] <- 0
delta[i,t[i,1]] <- 0
mu[i] ~ dnorm(0,.0001)
for (k in 1:na[i]) {
r[i,t[i,k]] ~ dbin(p[i,t[i,k]],n[i,t[i,k]])
logit(p[i,t[i,k]]) <- mu[i] + delta[i,t[i,k]] }
for (k in 2:na[i]) {
delta[i,t[i,k]] ~ dnorm(md[i,t[i,k]],taud[i,t[i,k]])
md[i,t[i,k]] <- d[t[i,k]] - d[t[i,1]] + sw[i,k]
taud[i,t[i,k]] <- tau *2*(k-1)/k
w[i,k] <- (delta[i,t[i,k]] - d[t[i,k]] + d[t[i,1]])
sw[i,k] <- sum(w[i,1:k-1])/(k-1)
}
}
d[1] <- 0
for (k in 2:nt) { d[k] ~ dnorm(0,.0001) }
sd ~ dunif(0,2)
tau <- 1/pow(sd,2)
for (i in 1:ns) { mu1[i] <- mu[i]*equals(t[i,1],1) }
for (k in 1:nt) { logit(T[k]) <- sum(mu1[])/5 + d[k] }
}
I tried several structures like the following, but it didn't succeed :
list(d=c(NA,0,0,0,0,0,0,0,0,0), sd=1, mu=c(0,0,0,0,0,0,0,0,0,0),
delta=structure(.Data=c(
NA,0, NA,0, NA,0,0, NA,0, NA,0, NA,0,0, NA,0, NA,0, NA,0, NA,0),
.Dim=c(10,3)))
NB : There are 3 arms in trials 3 and 6, and 2 arms otherwise
Any help would be very appreciated
Stéphanie
-------------------------------------------------------------------
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
|