On 05.09.2011 16:08, Kehl Dániel wrote:
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.



For model bulding and verification, I recommend to use BUGS directly. The interface is nice for running estimation processes and comparing models, not for building them.

Uwe Ligges

Thank you for you answer or any kind of help:
Daniel

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to