gertvv / gemtc

GeMTC R package: model generation for network meta-analysis
GNU General Public License v3.0
44 stars 25 forks source link

Enable DIC using BUGS #6

Closed gertvv closed 9 years ago

gertvv commented 10 years ago

DIC calculations are currently only done with JAGS. Enable them with BUGS.

gertvv commented 10 years ago

Thanks to Binod Neupane:

Mean residual deviance: Currently, the loading dic.sample module in rjags produces Mean deviance, pD, and DIC. But, evaluating a model at mean residual deviance is more informative. The way you have structured the model code is so nice, you can just add a few lines in the code:

for (i in 1:ns) {
  for (j in 1:na[i]) {
  line....for data with appropriate likelihood
  line for GLM model with appropriate link
  resdev[i,j] <- %resdev.i.j%
} 
resdev[i] <- sum(resdev[i, 1:na[i]])
} 
totalres <- sum(resdev[i])

Here, only thing you need to provide is %resdev.i.j% that depends on the type of likelihood of the data, but for a likelihood it is the same. So you may have to prepare a list of only 3 different formulas (for normal (one line), binomial (two lines) and Poisson (one line) likelihoods that are implemented in gemtc so far) for this. I am sure you know the references (Lu and Ades, 2004, 2006, 2009, Dias et al 2011 (NICE DSU TECHNICAL SUPPORT DOCUMENT 2), etc on the mean residual deviance. Finally, "totalres" would also be monitored to obtain its estimate. If you want, I can send some model codes that I edited and used in rjags to obtain mean residual deviance for some data application just for your reference. But, this step would have been unnecessary for me if gemtc already provide this option.

gertvv commented 9 years ago

Closing because support for BUGS has been dropped (e4f1409).