[R] sorry, [WinBUGS] question
Kehl Dániel
kehld at ktk.pte.hu
Mon Sep 5 16:08:16 CEST 2011
Dear Community,
I know this is not the place to ask WinBUGS questions, but I did not get
any answers on other lists.
I am rather new to the BUGS language and to bayesian modeling, excuse me
for probably simple questions.
I have to conduct a bayesian meta-analysis of some data. We have
collected observational and randomized studies related to a certain
field of interest.
The idea is to analyse the randomized studies with two different priors.
One is non-informative, the other is calculated from the observational
ones. We also want to use a sceptical prior.
The code I used for the non-informative prior analysis and to get the
other prior is following:
model
{
for( i in 1 : Num ) {
rc[i] ~ dbin(pc[i], nc[i])
rt[i] ~ dbin(pt[i], nt[i])
log(pc[i]) <- mu[i]
log(pt[i]) <- mu[i] + delta[i]
mu[i] ~ dnorm(0,1.0E-5)
delta[i] ~ dnorm(d, tau)
}
d ~ dnorm(0,1.0E-6)
tau ~ dgamma(0.001,0.001)
sigma <- 1 / sqrt(tau)
relr <- exp(d)
}
which appears to work fine after loading data and initials. (there was a
study with 0 treated and 0 control cases, I had to exclude that one for
some reasons, is there a solution for this?)
If I understand right, I can interpret the "relr" as bayesian estimate
of relative risk, with credible interval etc.
I have some questions in connection with the informative prior analysis:
- after running this same code for the observational data, how do I
change the specification of d and tau?
- how can I get posterior probabilities like relr>1?
- usually how many iterations, thin etc. do we use?
- can I get nice graphics with both priors and posteriors on it?
I do have to learn everything on my own, so any help is greatly
appreciated.
I know R and the BUGS package are able to communicate, is anybody can
help to solve the task through the R interface would be great.
Thank you for you answer or any kind of help:
Daniel
More information about the R-help
mailing list