rank.relative.array.Rd
Ranks "relative.table"
objects generated by get.relative()
.
# S3 method for class 'relative.array'
rank(x, lower_better = TRUE, ...)
An object of class("mbnma.rank")
which is a list containing a summary data
frame, a matrix of rankings for each MCMC iteration, and a matrix of probabilities
that each agent has a particular rank, for each parameter that has been ranked.
# \donttest{
# Using the triptans data
network <- mbnma.network(triptans)
#> Values for `agent` with dose = 0 have been recoded to `Placebo`
#> agent is being recoded to enforce sequential numbering
# Rank selected predictions from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
#> `likelihood` not given by user - set to `binomial` based on data provided
#> `link` not given by user - set to `logit` based on assigned value for `likelihood`
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 182
#> Unobserved stochastic nodes: 197
#> Total graph size: 4115
#>
#> Initializing model
#>
rels <- get.relative(emax)
rank <- rank(rels, lower_better=TRUE)
# Print and generate summary data frame for `mbnma.rank` object
summary(rank)
#> $RelativeEffects
#> rank.param mean sd 2.5% 25% 50% 75% 97.5%
#> 1 Placebo_0 23.000000 0.0000000 23.000 23 23 23 23
#> 2 eletriptan_0.5 11.705000 1.6352981 9.000 11 12 13 15
#> 3 eletriptan_1 5.906667 1.4901999 3.000 5 6 7 9
#> 4 eletriptan_2 2.640000 1.0577206 1.000 2 3 3 5
#> 5 sumatriptan_0.5 18.026333 1.4670915 15.000 17 18 19 21
#> 6 sumatriptan_1 13.606333 1.3114622 11.000 13 14 14 16
#> 7 sumatriptan_1.7 10.283333 0.9234030 9.000 10 10 11 12
#> 8 sumatriptan_2 8.671333 0.9974851 6.000 8 9 9 10
#> 9 frovatriptan_1 14.151667 2.2364401 10.000 13 14 16 19
#> 10 frovatriptan_2 4.243667 2.6299427 1.000 2 4 5 11
#> 11 almotriptan_0.5 20.892667 0.9588810 19.000 20 21 22 22
#> 12 almotriptan_1 15.900333 1.4375055 13.000 15 16 17 19
#> 13 almotriptan_2 6.246000 2.1781641 2.000 5 6 8 11
#> 14 zolmitriptan_0.4 18.439333 1.4492595 15.000 18 19 19 21
#> 15 zolmitriptan_1 12.128000 1.4577349 9.000 11 12 13 15
#> 16 zolmitriptan_2 6.545333 1.6141499 4.000 5 6 8 10
#> 17 zolmitriptan_4 3.214667 1.3482795 2.000 2 3 4 7
#> 18 zolmitriptan_10 1.529667 1.0463356 1.000 1 1 2 5
#> 19 naratriptan_1 20.387333 1.4850504 17.000 19 20 22 22
#> 20 naratriptan_2 14.839333 3.4334796 8.000 12 15 17 21
#> 21 rizatriptan_0.25 20.945667 1.0368572 18.975 20 21 22 22
#> 22 rizatriptan_0.5 16.030000 1.2939570 13.000 15 16 17 18
#> 23 rizatriptan_1 6.667333 1.4329517 4.000 6 7 8 9
#>
print(rank)
#>
#> ================================
#> Ranking of dose-response MBNMA
#> ================================
#>
#> Includes ranking of relative effects
#>
#> 23 relefs ranked with negative responses being `worse`
#>
#> RelativeEffects ranking (from best to worst)
#>
#> |Treatment | Mean| Median| 2.5%| 97.5%|
#> |:----------------|-----:|------:|-----:|-----:|
#> |zolmitriptan_10 | 1.53| 1| 1.00| 5|
#> |eletriptan_2 | 2.64| 3| 1.00| 5|
#> |zolmitriptan_4 | 3.21| 3| 2.00| 7|
#> |frovatriptan_2 | 4.24| 4| 1.00| 11|
#> |eletriptan_1 | 5.91| 6| 3.00| 9|
#> |almotriptan_2 | 6.25| 6| 2.00| 11|
#> |zolmitriptan_2 | 6.55| 6| 4.00| 10|
#> |rizatriptan_1 | 6.67| 7| 4.00| 9|
#> |sumatriptan_2 | 8.67| 9| 6.00| 10|
#> |sumatriptan_1.7 | 10.28| 10| 9.00| 12|
#> |eletriptan_0.5 | 11.70| 12| 9.00| 15|
#> |zolmitriptan_1 | 12.13| 12| 9.00| 15|
#> |sumatriptan_1 | 13.61| 14| 11.00| 16|
#> |frovatriptan_1 | 14.15| 14| 10.00| 19|
#> |naratriptan_2 | 14.84| 15| 8.00| 21|
#> |almotriptan_1 | 15.90| 16| 13.00| 19|
#> |rizatriptan_0.5 | 16.03| 16| 13.00| 18|
#> |sumatriptan_0.5 | 18.03| 18| 15.00| 21|
#> |zolmitriptan_0.4 | 18.44| 19| 15.00| 21|
#> |naratriptan_1 | 20.39| 20| 17.00| 22|
#> |almotriptan_0.5 | 20.89| 21| 19.00| 22|
#> |rizatriptan_0.25 | 20.95| 21| 18.98| 22|
#> |Placebo_0 | 23.00| 23| 23.00| 23|
#>
#>
# Plot `mbnma.rank` object
plot(rank)
# }