Hello!
I am just sharing code I got from Andrew Gelman. This shows what I
wanted to do.
for (i in 1:N) {
y[i] ~ dnorm(y.hat[i], tau.y)
y.hat[i] <- alpha + beta[b[i]] + gamma[g[i]]
}
tau.y <- pow(sigma.y, -2)
alpha.adj <- alpha + mean(beta[]) + mean(gamma[])
alpha ~ dnorm(0, 0.0001)
for (i in 1:3) {
beta[i] <- dnorm(0, 0.0001)
beta.adj[i] <- beta[i] - mean(beta[])
gamma[i] <- dnorm(0, 0.0001)
gamma.adj[i] <- gamma[i] - mean(gamma[])
}
--
Lep pozdrav / With regards,
Gregor Gorjanc
----------------------------------------------------------------------
University of Ljubljana PhD student
Biotechnical Faculty
Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan
Groblje 3 mail: gregor.gorjanc <at> bfro.uni-lj.si
SI-1230 Domzale tel: +386 (0)1 72 17 861
Slovenia, Europe fax: +386 (0)1 72 17 888
----------------------------------------------------------------------
"One must learn by doing the thing; for though you think you know it,
you have no certainty until you try." Sophocles ~ 450 B.C.
----------------------------------------------------------------------
-------------------------------------------------------------------
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
|