rank.mbnma.predict.Rd
Ranks predictions at different doses from best to worst.
# S3 method for mbnma.predict
rank(x, lower_better = TRUE, rank.doses = NULL, ...)
An object on which to apply the rank method
Indicates whether negative responses are better (TRUE
) or positive responses are better (FALSE
)
A list of numeric vectors. Each named element corresponds to an
agent (as named/coded in predict
), and each number within the vector for that element corresponds to the dose
for that agent. Doses of agents specified in rank.doses
must be a subset of those
for which responses have been predicted in predict
. If left as NULL
(the default)
then all doses of all agents in predict
will be ranked.
Arguments to be passed to methods
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.
If predict
contains multiple predictions at dose=0, then only the first of these
will be included, to avoid duplicating rankings.
# \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 all predictions from a log-linear dose-response MBNMA
loglin <- mbnma.run(network, fun=dloglin())
#> `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: 77
#> Total graph size: 3644
#>
#> Initializing model
#>
pred <- predict(loglin, E0 = 0.5)
rank <- rank(pred)
summary(rank)
#> $Predictions
#> rank.param mean sd 2.5% 25% 50% 75%
#> 1 Placebo_0 183.991667 0.45643546 184.000 184.00 184.0 184.00
#> 2 eletriptan_0.069 175.893333 1.85124226 172.000 175.00 176.0 177.00
#> 3 eletriptan_0.14 163.700667 3.55733296 154.000 162.75 165.0 166.00
#> 4 eletriptan_0.21 151.470000 4.89990847 139.000 149.00 153.0 155.00
#> 5 eletriptan_0.28 138.529333 5.33653749 128.000 135.00 139.0 143.00
#> 6 eletriptan_0.34 128.557333 5.25318109 119.000 124.00 129.0 133.00
#> 7 eletriptan_0.41 118.008667 4.89536309 110.000 114.00 117.0 122.00
#> 8 eletriptan_0.48 107.749333 4.72072678 99.000 105.00 108.0 111.00
#> 9 eletriptan_0.55 97.700000 4.58632149 89.000 95.00 98.0 101.00
#> 10 eletriptan_0.62 89.070000 4.36349784 80.000 86.00 89.0 92.00
#> 11 eletriptan_0.69 81.166667 4.64378550 72.000 78.00 81.0 84.00
#> 12 eletriptan_0.76 73.445000 4.90078030 64.000 70.00 74.0 77.00
#> 13 eletriptan_0.83 66.044333 5.18562096 55.000 63.00 66.0 70.00
#> 14 eletriptan_0.9 58.773333 5.51779886 48.000 55.00 59.0 63.00
#> 15 eletriptan_0.97 51.804000 5.48619025 41.000 48.00 52.0 55.00
#> 16 eletriptan_1 48.513667 5.32696963 38.975 45.00 48.0 52.00
#> 17 eletriptan_1.1 41.697000 4.23806301 34.000 39.00 42.0 44.00
#> 18 eletriptan_1.2 37.530333 3.37315964 32.000 35.00 38.0 40.00
#> 19 eletriptan_1.3 34.728333 2.93008402 31.000 32.00 34.0 37.00
#> 20 eletriptan_1.4 32.293333 2.64857708 29.000 30.00 31.0 34.00
#> 21 eletriptan_1.5 30.096000 2.31816924 27.000 28.00 29.0 31.00
#> 22 eletriptan_1.6 28.057000 1.99392651 25.000 27.00 28.0 29.00
#> 23 eletriptan_1.7 26.185333 1.73781229 23.975 25.00 26.0 27.00
#> 24 eletriptan_1.8 24.377333 1.58296815 22.000 23.00 24.0 25.00
#> 25 eletriptan_1.9 22.664333 1.49144316 20.000 22.00 23.0 24.00
#> 26 eletriptan_2 20.980000 1.43467282 18.000 20.00 21.0 22.00
#> 27 sumatriptan_0.069 179.810333 1.37173386 177.000 179.00 180.0 181.00
#> 28 sumatriptan_0.14 172.336000 2.33700475 167.000 172.00 173.0 174.00
#> 29 sumatriptan_0.21 165.850000 3.35558042 157.000 165.00 167.0 168.00
#> 30 sumatriptan_0.28 158.483333 4.22875273 147.000 157.00 160.0 161.00
#> 31 sumatriptan_0.34 152.284333 4.85599438 139.000 150.00 153.0 156.00
#> 32 sumatriptan_0.41 144.831333 5.26372370 133.000 142.00 146.0 149.00
#> 33 sumatriptan_0.48 137.663667 5.32647510 127.000 134.00 138.0 142.00
#> 34 sumatriptan_0.55 131.349000 5.23733478 122.000 127.00 132.0 135.00
#> 35 sumatriptan_0.62 125.190333 5.04055972 117.000 121.00 125.0 129.00
#> 36 sumatriptan_0.69 119.723333 4.75888690 112.000 116.00 119.0 123.00
#> 37 sumatriptan_0.76 114.274667 4.58340057 106.000 111.00 114.0 117.00
#> 38 sumatriptan_0.83 108.952000 4.42284409 101.000 106.00 109.0 112.00
#> 39 sumatriptan_0.9 103.746333 4.32182978 96.000 101.00 103.0 106.00
#> 40 sumatriptan_0.97 98.859000 4.14441525 91.000 96.00 99.0 101.00
#> 41 sumatriptan_1 96.306667 4.06474225 88.000 94.00 96.0 99.00
#> 42 sumatriptan_1.1 90.507333 3.96944980 82.000 88.00 91.0 93.00
#> 43 sumatriptan_1.2 85.048333 4.07752449 77.000 83.00 85.0 88.00
#> 44 sumatriptan_1.3 79.664333 4.27048868 71.000 77.00 80.0 83.00
#> 45 sumatriptan_1.4 74.470667 4.41002143 65.000 72.00 74.0 77.00
#> 46 sumatriptan_1.5 69.540000 4.46665987 60.000 67.00 70.0 73.00
#> 47 sumatriptan_1.6 64.793000 4.63810180 55.000 62.00 65.0 68.00
#> 48 sumatriptan_1.7 60.053667 4.84051617 50.000 57.00 60.0 63.00
#> 49 sumatriptan_1.8 55.409000 4.93313602 45.000 52.00 56.0 59.00
#> 50 sumatriptan_1.9 50.878333 4.94540355 41.000 48.00 51.0 54.00
#> 51 sumatriptan_2 46.663333 4.77600869 37.975 43.00 47.0 50.00
#> 52 frovatriptan_0.069 177.761667 1.64998122 174.000 177.00 178.0 179.00
#> 53 frovatriptan_0.14 168.395667 3.63934923 159.000 167.00 169.0 171.00
#> 54 frovatriptan_0.21 158.850333 5.61911541 145.000 156.00 160.0 163.00
#> 55 frovatriptan_0.28 149.052667 7.29348736 133.000 145.00 150.0 154.00
#> 56 frovatriptan_0.34 140.568667 8.15455602 124.000 135.00 141.0 146.00
#> 57 frovatriptan_0.41 131.540667 8.76637302 116.000 125.00 131.0 138.00
#> 58 frovatriptan_0.48 123.168000 9.23082763 106.000 117.00 123.0 129.00
#> 59 frovatriptan_0.55 115.173667 9.90711311 97.000 109.00 115.0 121.00
#> 60 frovatriptan_0.62 107.686667 10.51253189 89.000 100.00 108.0 115.00
#> 61 frovatriptan_0.69 100.563333 10.86992981 81.000 93.00 100.0 108.00
#> 62 frovatriptan_0.76 93.955000 11.21892433 74.000 86.00 93.0 101.00
#> 63 frovatriptan_0.83 87.717000 11.62049581 66.000 80.00 88.0 95.00
#> 64 frovatriptan_0.9 81.804667 12.11401783 59.000 74.00 82.0 89.00
#> 65 frovatriptan_0.97 76.083667 12.61133148 52.000 68.00 76.0 84.00
#> 66 frovatriptan_1 73.116333 12.82163268 49.000 64.00 73.0 82.00
#> 67 frovatriptan_1.1 65.991000 13.31104730 43.000 56.00 66.0 75.00
#> 68 frovatriptan_1.2 59.556333 13.25217089 41.000 48.00 59.0 69.00
#> 69 frovatriptan_1.3 53.867667 12.67923797 38.000 43.00 51.5 62.25
#> 70 frovatriptan_1.4 48.976000 11.80688605 35.000 40.00 45.0 56.00
#> 71 frovatriptan_1.5 44.832667 10.79991724 33.000 38.00 41.0 50.00
#> 72 frovatriptan_1.6 41.262667 9.82136239 30.000 35.00 38.0 44.00
#> 73 frovatriptan_1.7 38.110000 8.95250146 27.000 33.00 36.0 40.00
#> 74 frovatriptan_1.8 35.340000 8.25759020 25.000 31.00 34.0 37.00
#> 75 frovatriptan_1.9 32.817000 7.70943077 22.000 29.00 32.0 35.00
#> 76 frovatriptan_2 30.467667 7.28839224 20.000 26.00 30.0 33.00
#> 77 almotriptan_0.069 179.800000 1.49691246 177.000 179.00 180.0 181.00
#> 78 almotriptan_0.14 172.345000 2.49105937 167.000 172.00 173.0 174.00
#> 79 almotriptan_0.21 165.699333 3.65696468 156.000 164.00 166.0 168.00
#> 80 almotriptan_0.28 158.414333 4.61328755 146.000 156.00 159.0 161.00
#> 81 almotriptan_0.34 152.197000 5.36113529 139.000 149.00 153.0 156.00
#> 82 almotriptan_0.41 144.831667 5.98943139 132.000 141.00 145.5 149.00
#> 83 almotriptan_0.48 137.789333 6.13651681 126.000 134.00 138.0 142.00
#> 84 almotriptan_0.55 131.358667 6.17927337 120.000 127.00 131.0 136.00
#> 85 almotriptan_0.62 125.361333 6.08087964 115.000 121.00 125.0 130.00
#> 86 almotriptan_0.69 119.758667 6.00214685 109.000 115.00 119.0 124.00
#> 87 almotriptan_0.76 114.372000 5.98009503 104.000 110.00 114.0 118.00
#> 88 almotriptan_0.83 109.071333 6.08839889 98.000 105.00 109.0 113.00
#> 89 almotriptan_0.9 103.899667 6.11664977 93.000 100.00 104.0 108.00
#> 90 almotriptan_0.97 99.023333 6.10485151 88.000 95.00 99.0 103.00
#> 91 almotriptan_1 96.495667 6.06752994 85.000 92.00 96.0 100.00
#> 92 almotriptan_1.1 90.622000 6.07190843 79.000 87.00 90.0 94.00
#> 93 almotriptan_1.2 85.078667 6.25829052 73.000 81.00 85.0 89.00
#> 94 almotriptan_1.3 79.766667 6.56124268 67.000 75.00 80.0 84.00
#> 95 almotriptan_1.4 74.585000 6.81255547 61.000 70.00 74.0 79.00
#> 96 almotriptan_1.5 69.645000 7.09444045 56.000 65.00 70.0 74.00
#> 97 almotriptan_1.6 64.812000 7.46908641 50.000 60.00 65.0 70.00
#> 98 almotriptan_1.7 60.010667 7.76762501 45.000 55.00 60.0 65.00
#> 99 almotriptan_1.8 55.439000 7.92825526 41.000 50.00 55.0 61.00
#> 100 almotriptan_1.9 51.058667 7.83383779 37.975 45.00 50.0 56.00
#> 101 almotriptan_2 47.103667 7.56557990 35.000 41.75 46.0 52.00
#> 102 zolmitriptan_0.34 144.470000 5.61702326 132.000 141.00 145.0 149.00
#> 103 zolmitriptan_0.69 106.709000 5.60125971 96.000 103.00 107.0 110.00
#> 104 zolmitriptan_1 81.266667 5.82696663 70.000 77.00 81.0 85.00
#> 105 zolmitriptan_1.4 54.811667 7.22432886 41.000 50.00 55.0 60.00
#> 106 zolmitriptan_1.7 41.043333 5.07707735 33.000 37.00 41.0 44.00
#> 107 zolmitriptan_2.1 33.539000 3.38835840 29.000 31.00 33.0 36.00
#> 108 zolmitriptan_2.4 29.608667 2.89061299 25.000 28.00 29.0 31.00
#> 109 zolmitriptan_2.8 25.570667 2.39838633 22.000 24.00 25.0 27.00
#> 110 zolmitriptan_3.1 22.893667 1.92828058 21.000 21.00 23.0 24.00
#> 111 zolmitriptan_3.4 20.841667 1.35936744 20.000 20.00 20.0 21.00
#> 112 zolmitriptan_3.8 19.221333 0.69174012 19.000 19.00 19.0 19.00
#> 113 zolmitriptan_4.1 18.067333 0.37883250 18.000 18.00 18.0 18.00
#> 114 zolmitriptan_4.5 17.012333 0.19199004 17.000 17.00 17.0 17.00
#> 115 zolmitriptan_4.8 16.005000 0.13030986 16.000 16.00 16.0 16.00
#> 116 zolmitriptan_5.2 15.002333 0.11104954 15.000 15.00 15.0 15.00
#> 117 zolmitriptan_5.5 14.001667 0.09128709 14.000 14.00 14.0 14.00
#> 118 zolmitriptan_5.9 13.001333 0.07302967 13.000 13.00 13.0 13.00
#> 119 zolmitriptan_6.2 12.001333 0.07302967 12.000 12.00 12.0 12.00
#> 120 zolmitriptan_6.6 11.001000 0.05477226 11.000 11.00 11.0 11.00
#> 121 zolmitriptan_6.9 10.000667 0.03651484 10.000 10.00 10.0 10.00
#> 122 zolmitriptan_7.2 9.000667 0.03651484 9.000 9.00 9.0 9.00
#> 123 zolmitriptan_7.6 8.000333 0.01825742 8.000 8.00 8.0 8.00
#> 124 zolmitriptan_7.9 7.000333 0.01825742 7.000 7.00 7.0 7.00
#> 125 zolmitriptan_8.3 6.000000 0.00000000 6.000 6.00 6.0 6.00
#> 126 zolmitriptan_8.6 5.000000 0.00000000 5.000 5.00 5.0 5.00
#> 127 zolmitriptan_9 4.000000 0.00000000 4.000 4.00 4.0 4.00
#> 128 zolmitriptan_9.3 3.000000 0.00000000 3.000 3.00 3.0 3.00
#> 129 zolmitriptan_9.7 2.000000 0.00000000 2.000 2.00 2.0 2.00
#> 130 zolmitriptan_10 1.000000 0.00000000 1.000 1.00 1.0 1.00
#> 131 naratriptan_0.069 182.979667 0.43739798 183.000 183.00 183.0 183.00
#> 132 naratriptan_0.14 179.856667 1.60030493 177.000 179.00 179.0 181.00
#> 133 naratriptan_0.21 176.463667 2.11931838 173.000 175.00 177.0 178.00
#> 134 naratriptan_0.28 173.224333 2.61233280 168.000 172.00 173.0 175.00
#> 135 naratriptan_0.34 170.441333 3.07544756 164.000 169.00 170.0 173.00
#> 136 naratriptan_0.41 167.416000 3.74863906 160.000 165.00 168.0 170.00
#> 137 naratriptan_0.48 164.355333 4.40865251 155.000 162.00 164.0 168.00
#> 138 naratriptan_0.55 161.334000 5.10017463 151.000 158.00 162.0 165.00
#> 139 naratriptan_0.62 158.301000 5.84543600 146.000 154.00 159.0 162.00
#> 140 naratriptan_0.69 155.303333 6.52984445 142.000 151.00 156.0 160.00
#> 141 naratriptan_0.76 152.313000 7.24241087 138.000 147.00 153.0 157.00
#> 142 naratriptan_0.83 149.387333 7.87032106 134.000 144.00 150.0 155.00
#> 143 naratriptan_0.9 146.490000 8.48771153 130.000 141.00 147.0 153.00
#> 144 naratriptan_0.97 143.641000 9.09456006 126.000 137.00 144.0 150.00
#> 145 naratriptan_1 141.877667 9.34172310 123.000 136.00 142.0 148.00
#> 146 naratriptan_1.1 138.333667 10.15713488 118.000 131.00 138.0 146.00
#> 147 naratriptan_1.2 134.888000 10.98597681 112.000 128.00 135.0 142.00
#> 148 naratriptan_1.3 131.465000 11.78424362 107.000 124.00 132.0 139.00
#> 149 naratriptan_1.4 128.131000 12.59065846 101.000 120.00 128.0 137.00
#> 150 naratriptan_1.5 124.852667 13.40241898 97.000 116.00 125.0 134.00
#> 151 naratriptan_1.6 121.654667 14.17245089 92.000 113.00 122.0 131.00
#> 152 naratriptan_1.7 118.454667 14.92752118 88.000 109.00 119.0 129.00
#> 153 naratriptan_1.8 115.364667 15.65684293 83.975 105.00 116.0 126.00
#> 154 naratriptan_1.9 112.285000 16.34674831 79.000 101.00 113.0 124.00
#> 155 naratriptan_2 109.266000 17.02053104 75.000 97.00 110.0 121.00
#> 156 rizatriptan_0.034 181.657000 1.13068290 180.000 181.00 182.0 182.00
#> 157 rizatriptan_0.069 174.777333 1.96732721 171.000 174.00 175.0 176.00
#> 158 rizatriptan_0.1 169.315000 2.75650282 163.000 168.00 170.0 171.00
#> 159 rizatriptan_0.14 161.852667 3.73143414 152.000 161.00 163.0 164.00
#> 160 rizatriptan_0.17 156.322667 4.33468369 145.000 155.00 157.0 159.00
#> 161 rizatriptan_0.21 148.496333 4.98078869 136.000 146.00 150.0 152.00
#> 162 rizatriptan_0.24 142.394333 5.22410423 131.000 139.00 143.0 146.00
#> 163 rizatriptan_0.28 134.844333 5.15728938 125.000 131.00 135.0 139.00
#> 164 rizatriptan_0.31 129.500667 5.08867675 121.000 125.00 130.0 133.00
#> 165 rizatriptan_0.34 124.240000 4.88108680 116.000 120.00 124.0 128.00
#> 166 rizatriptan_0.38 117.902000 4.70855103 110.000 115.00 117.0 121.00
#> 167 rizatriptan_0.41 112.956000 4.57059742 105.000 110.00 113.0 116.00
#> 168 rizatriptan_0.45 106.664333 4.59180677 98.000 104.00 106.0 109.00
#> 169 rizatriptan_0.48 101.719000 4.57562576 93.000 99.00 102.0 104.00
#> 170 rizatriptan_0.52 95.851667 4.46090018 87.000 93.00 96.0 99.00
#> 171 rizatriptan_0.55 91.612333 4.27100242 83.000 89.00 92.0 94.00
#> 172 rizatriptan_0.59 86.713000 4.32221296 78.000 84.00 87.0 90.00
#> 173 rizatriptan_0.62 82.821000 4.45311529 74.000 80.00 83.0 86.00
#> 174 rizatriptan_0.66 78.024333 4.63748243 69.000 75.00 78.0 81.00
#> 175 rizatriptan_0.69 74.302000 4.72294732 65.000 71.00 74.0 77.00
#> 176 rizatriptan_0.72 70.649667 4.84493801 61.000 68.00 71.0 74.00
#> 177 rizatriptan_0.76 66.137667 5.03817185 56.000 63.00 66.0 70.00
#> 178 rizatriptan_0.79 62.511000 5.17237503 52.000 59.00 63.0 66.00
#> 179 rizatriptan_0.83 58.009000 5.34806379 47.000 54.00 58.0 62.00
#> 180 rizatriptan_0.86 54.457667 5.39468029 44.000 51.00 54.0 58.00
#> 181 rizatriptan_0.9 50.210667 5.26537694 40.000 47.00 50.0 54.00
#> 182 rizatriptan_0.93 47.078000 4.97984427 38.000 44.00 47.0 50.00
#> 183 rizatriptan_0.97 43.703333 4.56730507 35.000 40.00 44.0 46.00
#> 184 rizatriptan_1 41.215000 4.26726042 34.000 38.00 41.0 44.00
#> 97.5%
#> 1 184.000
#> 2 178.000
#> 3 168.000
#> 4 158.000
#> 5 147.000
#> 6 138.000
#> 7 128.000
#> 8 118.000
#> 9 107.000
#> 10 97.000
#> 11 90.000
#> 12 82.000
#> 13 76.000
#> 14 69.000
#> 15 63.000
#> 16 59.000
#> 17 51.000
#> 18 44.000
#> 19 40.000
#> 20 38.000
#> 21 36.000
#> 22 33.000
#> 23 31.000
#> 24 28.000
#> 25 26.000
#> 26 24.000
#> 27 181.000
#> 28 175.000
#> 29 170.000
#> 30 164.000
#> 31 159.000
#> 32 153.000
#> 33 147.000
#> 34 141.000
#> 35 135.000
#> 36 129.000
#> 37 124.000
#> 38 118.000
#> 39 113.000
#> 40 108.000
#> 41 105.000
#> 42 98.000
#> 43 93.000
#> 44 87.025
#> 45 83.000
#> 46 78.000
#> 47 74.000
#> 48 69.000
#> 49 65.000
#> 50 61.000
#> 51 56.000
#> 52 181.000
#> 53 174.000
#> 54 168.000
#> 55 161.000
#> 56 156.000
#> 57 149.000
#> 58 143.000
#> 59 136.000
#> 60 130.000
#> 61 124.000
#> 62 118.000
#> 63 113.000
#> 64 107.000
#> 65 102.000
#> 66 98.025
#> 67 93.000
#> 68 86.025
#> 69 81.000
#> 70 76.000
#> 71 71.000
#> 72 67.000
#> 73 62.025
#> 74 58.000
#> 75 53.000
#> 76 49.000
#> 77 181.000
#> 78 175.000
#> 79 170.000
#> 80 165.000
#> 81 160.000
#> 82 154.000
#> 83 149.000
#> 84 143.000
#> 85 138.000
#> 86 132.000
#> 87 127.000
#> 88 122.000
#> 89 117.000
#> 90 112.000
#> 91 110.000
#> 92 103.000
#> 93 98.000
#> 94 92.000
#> 95 88.000
#> 96 83.025
#> 97 79.000
#> 98 75.000
#> 99 71.000
#> 100 67.000
#> 101 63.000
#> 102 153.000
#> 103 119.000
#> 104 92.000
#> 105 69.000
#> 106 52.000
#> 107 40.000
#> 108 36.000
#> 109 31.000
#> 110 28.000
#> 111 24.000
#> 112 21.000
#> 113 19.000
#> 114 17.000
#> 115 16.000
#> 116 15.000
#> 117 14.000
#> 118 13.000
#> 119 12.000
#> 120 11.000
#> 121 10.000
#> 122 9.000
#> 123 8.000
#> 124 7.000
#> 125 6.000
#> 126 5.000
#> 127 4.000
#> 128 3.000
#> 129 2.000
#> 130 1.000
#> 131 183.000
#> 132 182.000
#> 133 181.000
#> 134 179.000
#> 135 176.000
#> 136 174.000
#> 137 173.000
#> 138 170.000
#> 139 169.000
#> 140 166.000
#> 141 165.000
#> 142 163.000
#> 143 162.000
#> 144 160.000
#> 145 159.000
#> 146 157.000
#> 147 154.025
#> 148 152.000
#> 149 151.000
#> 150 149.000
#> 151 147.000
#> 152 145.000
#> 153 144.000
#> 154 142.000
#> 155 140.000
#> 156 182.000
#> 157 177.000
#> 158 172.000
#> 159 166.000
#> 160 162.000
#> 161 156.000
#> 162 151.000
#> 163 144.000
#> 164 139.000
#> 165 134.000
#> 166 127.000
#> 167 122.000
#> 168 116.000
#> 169 111.000
#> 170 105.000
#> 171 100.000
#> 172 95.000
#> 173 91.000
#> 174 87.000
#> 175 83.000
#> 176 80.000
#> 177 76.000
#> 178 72.000
#> 179 68.000
#> 180 65.000
#> 181 61.000
#> 182 58.000
#> 183 54.000
#> 184 50.000
#>
# 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
#>
doses <- list("eletriptan"=c(0,1,2,3), "rizatriptan"=c(0.5,1,2))
pred <- predict(emax, E0 = "rbeta(n, shape1=1, shape2=5)",
exact.doses=doses)
rank <- rank(pred,
rank.doses=list("eletriptan"=c(0,2), "rizatriptan"=2))
# Print and generate summary data frame for `mbnma.rank` object
summary(rank)
#> $Predictions
#> rank.param mean sd 2.5% 25% 50% 75% 97.5%
#> 1 eletriptan_0 3.000 0.00000000 3 3 3 3 3
#> 2 eletriptan_2 1.998 0.04468406 2 2 2 2 2
#> 3 rizatriptan_2 1.002 0.04468406 1 1 1 1 1
#>
print(rank)
#>
#> ================================
#> Ranking of dose-response MBNMA
#> ================================
#>
#> Includes ranking of predictions from dose-response MBNMA
#>
#> 3 predictions ranked with negative responses being `worse`
#>
#> Predictions ranking (from best to worst)
#>
#> |Treatment | Mean| Median| 2.5%| 97.5%|
#> |:-------------|----:|------:|----:|-----:|
#> |rizatriptan_2 | 1| 1| 1| 1|
#> |eletriptan_2 | 2| 2| 2| 2|
#> |eletriptan_0 | 3| 3| 3| 3|
#>
#>
# Plot `mbnma.rank` object
plot(rank)
# }