OpenBUGS Code gives error 'expected a comma' in survival

368 views Asked by At

I am trying to fit a hierarchical model using OpenBUGS, with the following code:

model
{
    for (i in 1:N) {
          for (j in 1:M){
# Survival times bounded below by censoring times:
            t[i,j] ~ dweib(r,mu[i,j]) I(cen[i,j],);
            mu[i,j] <- b[i]*exp(beta);
            }
# Random effects:
        b[i] ~dlnorm(mu, tau)
    }
# Priors:
    beta ~ dnorm(0, 0.001);
     tau ~ dgamma(1.0E-3, 1.0E-3);
    r~ dgamma(1, 1.0E-3);
    sigma2<-1/tau
    mu<-(-1)/2*tau
}

But, I get the
error : 'expected a comma', and OpenBUGS highlights tausg in the tau... what I am doing wrong. thanks

1

There are 1 answers

0
amg On

You have specified mu in two places - once as mu[i,j] <- b[i]*exp(beta), and then later as mu<-(-1)/2*tau. You need to change the name of one of them.