audrey-b / BUGSnet

BUGSnet: a new comprehensive package for network meta-analysis
Other
23 stars 9 forks source link

Error after nma.run #69

Closed r-korde closed 3 years ago

r-korde commented 3 years ago

Hi, I'm running a network metanalysis using BUGSnet an R package relied in JAGS. I've recently started learning R. When I use nma.run function, following error message comes up - Error in jags.model(textConnection(model$bugs), model$data, n.chains = n.chains, : Error in node (log((n[1,1]-r[1,1]))) Invalid parent values Could anyone please help? I have attached the excel sheet and my code is as follows:

library(BUGSnet) osdataset<-read_excel ("/Users/rasikakorde/Downloads/R_exp/SCLC_OS.xlsx")

os.data <- data.prep(arm.data = osdataset,varname.t = "treatment", varname.s = "study") par(mar=c(1,1,1,1)) net.plot(os.data, node.scale = 3, edge.scale=1.5) net.plot(os.data, node.scale = 3, edge.scale=1.5, flag = "EP") network.char <- net.tab(data = os.data, N = "n", outcome = "OS", time = "followup", type.outcome = "rate2") data.plot(data = os.data, covariate = "age", half.length = "age_SD", by = "treatment", avg.hline = TRUE, text.size = 12) random_effects_model <- nma.model(data = os.data, outcome = "OS", N = "n", reference = "EP", family = "binomial", link = "cloglog", time = "followup", effects = "random") fixed_effects_model <- nma.model(data = os.data, outcome = "OS", N = "n", reference = "EP", family = "binomial", link = "cloglog", time = "followup", effects = "fixed") set.seed(20190828) fixed_effects_results <- nma.run(fixed_effects_model, n.adapt=1000, n.burnin=1000,n.iter=10000)

Thanks a ton!

Regards, RK SCLC_OS.xlsx

audrey-b commented 3 years ago

Could it be that in your data OS is larger than n for study Leal_2021? This shouldn't be possible with a binomial outcome.

I reverted OS and n for this study and the code works fine.

r-korde commented 3 years ago

Fixed it, thanks!