Dear All,
On December 30, 2002, I posted a question about the syntax of my logistic-
Normal model. That posting is at the end. Thank you to Nicky G Best,
Andrew Thomas, Andrew Millard and David Spiegelhalter for correcting my
mistake. The problem was with the random effects vector 'e'. The
corrected syntax is below.
model
{
for (j in 1: islands) {
for (i in 1:species) {
Y[j, i] ~ dbern(p[j, i])
logit(p[ j, i]) <- beta0 + beta1* x1[ j, i] + e[j , i] }
e[j,1:2] ~ dmnorm(mean0[], R
[, ]) }
beta0 ~ dnorm(0.0, 0.001)
beta1 ~ dnorm(0.0, 0.001)
R[1:2,1:2] ~ dwish(Omega[ , ], 2)
Sigma[1:2, 1:2] <- inverse(R[ , ])
}
Rodney Sparapani suggests the following approach. Thank you. He writes,
"I think I understand the error that you are seeing and a possible
solution. I've worked on logitudinal data. What you probably have to do is
create several Ys, one for each island. Then you will eliminate the index j
in a way that BUGS will be able to deal with."
#############################################
# Posted on December 30, 2002
Dear All,
I am a first time BUGS user. I am trying to fit a simplified version of my
model in BUGS. The data are correlated vectors of binary data and there is
a correlation structure within each vector. For now, I am going to ignore
the correlation between the vectors.
The data is Y[i,j]=1 if species 'i' is present on island 'j'; i=1,2 &
j=1,...,25. Otherwise, Y[i,j]=0. I want to fit a logistic regression
model with a random effect term e[i,j] where for a fixed 'j', the
covariance matrix for the vector (e[1,j],e[2,j]) is \sigma_{1,2} and
Cov(e[1,j],e[1,j])= \sigma_{1,1}, etc. I used the following syntax for the
model, the data and initial values. The error comes in when I ask BUGS to
compile.
The error says 'vector valued relation e must involve consecutive elements
of variable'.
Thank you for your help.
#model specification:
model
{
for (i in 1: species) {
for (j in 1:islands) {
Y[i, j] ~ dbern(p[i, j])
logit(p[i, j]) <- beta0 + beta1* x1[i , j]+ e[i,j]
e[1:2, j] ~ dmnorm(mean0[],R[,])
} }
beta0 ~ dnorm(0.0, 0.001)
beta1 ~ dnorm(0.0, 0.001)
R[1:2,1:2] ~ dwish(Omega[ , ], 2)
Sigma[1:2, 1:2] <- inverse(R[ , ])
}
-------------------------------------------------------------------
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
|