file <- system.file("extdata/luades-smoking.gemtc", package="gemtc")
network <- read.mtc.network(file)
model <- mtc.model(network)
# To save computation time we load the samples instead of running the model
results <- mtc.run(model)
file.samples <- system.file("extdata/luades-smoking.samples.gz", package="gemtc")
results <- read.mtc.result.samples(file.samples, model, "rjags")
# Creates a forest plot of the relative effects
forest(relative.effect(results, "A"))
summary(relative.effect(results, "B", c("A", "C", "D")))
## Iterations = 5001:25000
## Thinning interval = 1
## Number of chains = 4
## Sample size per chain = 20000
##
## 1. Empirical mean and standard deviation for each variable,
## plus standard error of the mean:
##
## Mean SD Naive SE Time-series SE
## d.B.A -0.4972 0.4074 0.0014405 0.005862
## d.B.C 0.3418 0.4154 0.0014686 0.004880
## d.B.D 0.6054 0.4892 0.0017295 0.006443
## sd.d 0.8500 0.1905 0.0006736 0.004591
##
## 2. Quantiles for each variable:
##
## 2.5% 25% 50% 75% 97.5%
## d.B.A -1.3264 -0.75931 -0.4856 -0.2265 0.2807
## d.B.C -0.4840 0.07435 0.3415 0.6091 1.1662
## d.B.D -0.3600 0.28917 0.5979 0.9214 1.5823
## sd.d 0.5531 0.71509 0.8253 0.9568 1.2928
Run the code above in your browser using DataLab