[R] The error while using R2WinBUGS

From: Li, Jia <LI_at_nsabp.pitt.edu>
Date: Thu 26 May 2005 - 02:15:20 EST


Dear all,  

I tried to run WinBUGS model in R by using package R2WinBUGS, but I failed because of the massage : cannot calculate DIC for model in log file of WinBUGS14. In fact, the model works in WinBUGS and I can get summaries of the model, such as density, stats..., except DIC , because DIC may not be appropriate in this kind of model due to some reasons(according to the manual of WinBUGS14), and WinBUGS cannot calculate it, but this is allowed in WinBUGS. If I just ran it in WinBUGS, that would be fine, because my goal is to get the summay not DIC, but I need to run it in R, and R must have DIC. (the example as follow). I am wondering what I can do to fix it in R?  

for exampe: the school example:
the output in R:

> print(schools.sim)

Inference for Bugs model at "c:/schools/schools.bug" 3 chains, each with 1000 iterations (first 500 discarded) n.sims = 1500 iterations saved
mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff theta[1] 11.1 9.1 -3.0 5.0 10.0 16.0 31.8 1.1 39 .....
theta[8] 8.3 8.4 -6.6 2.8 8.1 12.7 26.2 1.0 64 mu.theta 7.6 5.9 -3.0 3.7 8.0 11.0 19.5 1.1 35 .....
deviance 60.8 2.5 57.0 59.1 60.2 62.1 66.6 1.0 170 pD = 3 and DIC = 63.8 (using the rule, pD = var(deviance)/2)  

Thanks a lot,  

Jia

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 26 02:18:15 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:05 EST