Dear Winbugs users,
I am triyng to running a hierarchical model for a categorical response variable.The model is
model
{
#
for (i in 1 : M) {
for (k in (n[i]+1):n[i+1]) {
for (j in 1 : Ncut) {
# Cumulative probability of worse response than j
logit(Q[k, j]) <- -(alfa[j] + beta[1] + beta[2] * x[k]+ b[i])
}
# Probability of response = j
p[k, 1] <- 1 - Q[k, 1]
for (j in 2 : Ncut) { p[k, j] <- Q[k, j - 1] - Q[k, j] }
p[k, (Ncut+1)] <- Q[k, Ncut]
response[k] ~ dcat(p[k, ])
}
# Subject (random) effects
b[i] ~ dnorm(0.0, tau)
}
#priors
beta[1] ~ dnorm(0, 1.0E-06)
beta[2] ~ dnorm(0, 1.0E-06)
tau ~ dgamma(1.0E-1,1.0E-1)
for (k in 1:n[M+1]) {
e[k] ~ dnorm(0.0, taue)
}
sigmae<-1/taue
taue ~ dgamma(1.0E-1,1.0E-1)
# ordered cut points for underlying continuous latent variable
alfa[1] ~ dnorm(0, 1.0E-06)I(, alfa[2])
alfa[2] ~ dnorm(0, 1.0E-06)I(alfa[1], alfa[3])
alfa[3] ~ dnorm(0, 1.0E-06)I(alfa[2], )
}
an example of data I have tried to use is
list( M=5, Ncut=3, n=c(0, 7, 8, 15, 19, 23),
response=c(2,2,2,1,2,1,3,3,3,1,1,1,2,1,2,1,2,1,2,1,3,1,2),
x=c(2,1,2,2,2,1,2,2,2,2,2,1,1,2,2,2,2,2,2,2,1,1,1))
with inits
list(beta=c(0,0), tau=1, taue=1, alfa=c(-89, 23, 45))
Winbugs compile and initialize the model but then it gives me the error message "undefined real result".
Which problem can create a message of this kind?
I would be very obliged if someone gives me an answer.
Elena
------------------------------------------------------------------------
Questo messaggio e' stato inviato con Telemail http://www.telemail.it ,
La freemail per la comunicazione unificata gratuita
-------------------------------------------------------------------
To mail the BUGS list, mail to [log in to unmask]
You can search old messages at www.jiscmail.ac.uk/lists/bugs.html
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
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]
|