gertvv / gemtc

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

Error in Rjags #57

Closed robsmith112 closed 4 years ago

robsmith112 commented 4 years ago

Hi,

I am trying to conduct a bayesian network meta-analysis in R using the gemtc package, which makes use of the rjags package. Aplologies if this is the wrong place to post, I'm just starting self-learning NMA and bayesian analysis.

My data contains 27 trials with 10 different treatments. My model is defined as:

model <- mtc.model(network, linearModel = "random", n.chain = 4)

mcmc1 <- mtc.run(model, n.adapt = 50, n.iter = 1000, thin = 10) mcmc2 <- mtc.run(model, n.adapt = 10000, n.iter = 500000, thin = 10)

For both mcmc1 & mcmc2 i get the following error:

Error in rjags::jags.model(file.model, data = syntax[["data"]], inits = syntax[["inits"]], : Error in node delta[27,2] Error calculting log density

I have no idea what problem this is related to, does anyone have any guideance?

Again aplologies if this it posted in the wrong place, I'm not sure of my error is related to JAGS or my gemtc package or maybe rjags. I am using https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/bayesnma.html as guidance for running my analysis.

Many thanks

gertvv commented 4 years ago

Thanks for the report Rob. I've replied to your email about this same issue.

gertvv commented 4 years ago

The cause was a data entry error: negative standard error. Added this to the open issue about input validation.