Hello, I have been working on a Bayesian network analysis in the "gemtc" package comparing many different treatments, with little back-up from multiple articles. I've installed all of the necessary packages (RJAGS, RJAGS2, coda, etc.). This is my data set called 'data':
study treatment diff std.err
1 A AA 0.4320000 0.3250000
2 A AB 0.2640000 0.3180000
3 A Placebo NA 0.3000000
4 B AC 0.4866500 0.2882700
5 B Placebo NA NA
6 C AD -0.3638236 0.2972214
7 C Placebo NA NA
8 D AE -0.4080000 0.3000000
9 D Placebo NA NA
10 E AF 1.1295000 0.3329000
11 E Placebo NA NA
12 F AB 0.6221200 0.2372800
13 F Placebo NA NA
14 G AG 1.2119132 0.2495278
15 G Placebo NA NA
16 H AH -0.7370000 0.2160000
17 H Placebo NA NA
18 I AB 0.2660000 0.0950000
19 I Placebo NA NA
Here is the necessary script:
network <- mtc.network(data.re = data)
summary(network)
nodesplit <- mtc.nodesplit(network,
linearModel = "random",
n.adapt = 5000,
n.iter = 100000,
thin = 10)
Once I run the mtc.nodesplit I get the following error:
Error in mtc.nodesplit(network, linearModel = "random", n.adapt = 5000, :
nrow(comparisons) > 0 is not TRUE
I used within the same script a dataset from a coworker of mine, which is a little bit larger. Hers works, so the only thing I could think of is that there is a problem within my dataset. Does anyone have any solutions for this error?
I also ran the Monte Carlo simulation, this worked without any problems.
Greetings.