Rank parameters from a time-course MBNMA
rank.mbnma.Rd
Ranks desired parameters saved from a time-course MBNMA model from "best" to "worst".
Usage
# S3 method for mbnma
rank(
x,
param = "auc",
lower_better = FALSE,
treats = NULL,
int.range = NULL,
n.iter = x$BUGSoutput$n.sims,
...
)
Arguments
- x
An S3 object of
class("mbnma")
generated by running a time-course MBNMA model- param
A character object containing any model parameter monitored in
mbnma
for which ranking is desired (e.g."beta.1"
,"emax"
). Parameters must vary by treatment for ranking to be possible. Can also be specified as"auc"
(see details).- lower_better
Indicates whether negative responses are better (
lower_better=TRUE
) or positive responses are better (lower_better=FALSE
)- treats
A character vector of treatment/class names (depending on the parameter to be ranked) or a numeric vector of treatment/class codes (as coded in
mbnma
) that indicate which treatments/classes to calculate rankings for. If left `NULL`` then rankings will be calculated for all treatments/classes.- int.range
A numeric vector with two elements that indicates the range over which to calculate AUC. Takes the form c(lower bound, upper bound). If left as
NULL
(the default) then the range will be between zero and the maximum follow-up time in the dataset.- n.iter
The number of iterations for which to calculate AUC (if
"auc"
is included inparams
). Must be a positive integer. Default is the value used inmbnma
.- ...
Arguments to be sent to
integrate()
Value
A named list whose elements include:
summary.rank
A data frame containing mean, sd, and quantiles for the ranks of each treatment given intreats
prob.matrix
A matrix of the proportions of MCMC results for which each treatment/class intreats
ranked in which position for the given parameterrank.matrix
A matrix of the ranks of MCMC results for each treatment/class intreats
for the given parameter.
Details
"auc"
can be specified in param
to rank treatments based on
Area Under the Curve (AUC). This accounts for the effect of multiple
time-course parameters simultaneously on the treatment response, but will
be impacted by the range of time over which AUC is calculated (int.range
).
This requires integration over int.range
and can take some time to run (particularly)
for spline functions as this uses the trapezoid method rather than adaptive quadrature).
Note that "auc"
can only be calculated at the treatment-level in class effect models.
As with other post-estimation functions, rank()
should only be performed on
models which have successfully converged. Note that rankings can be very sensitive to
even small changes in treatment effects and therefore failure to converge in only
one parameter may have substantial impact on rankings.
Examples
# \donttest{
# Create an mb.network object from a dataset
network <- mb.network(alog_pcfb)
#> Reference treatment is `placebo`
#> Studies reporting change from baseline automatically identified from the data
# Run an MBNMA model with an Emax time-course
emax <- mb.run(network,
fun=temax(pool.emax="rel", method.emax="common",
pool.et50="rel", method.et50="random"),
intercept=FALSE)
#> 'et50' parameters must take positive values.
#> Default half-normal prior restricts posterior to positive values.
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 233
#> Unobserved stochastic nodes: 71
#> Total graph size: 4363
#>
#> Initializing model
#>
# Rank treatments by time-course parameter from the model with lower scores being better
rank(emax, param=c("emax"), lower_better=TRUE)
#>
#> ========================================
#> Treatment rankings
#> ========================================
#>
#> emax ranking
#>
#> |Treatment | Mean| Median| 2.5%| 97.5%|
#> |:---------|----:|------:|----:|-----:|
#> |placebo | 6.00| 6| 6| 6|
#> |alog_6.25 | 4.88| 5| 4| 5|
#> |alog_12.5 | 4.09| 4| 4| 5|
#> |alog_25 | 3.01| 3| 3| 3|
#> |alog_50 | 1.99| 2| 2| 2|
#> |alog_100 | 1.03| 1| 1| 1|
#>
#>
# Rank treatments 1-3 by AUC
rank(emax, param="auc", treats=c(1:3), lower_better=TRUE,
int.range=c(0,20))
#>
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|== | 4%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|======= | 9%
|
|======= | 10%
|
|======= | 11%
|
|======== | 11%
|
|======== | 12%
|
|========= | 12%
|
|========= | 13%
|
|========= | 14%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 15%
|
|=========== | 16%
|
|============ | 16%
|
|============ | 17%
|
|============ | 18%
|
|============= | 18%
|
|============= | 19%
|
|============== | 19%
|
|============== | 20%
|
|============== | 21%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 22%
|
|================ | 23%
|
|================ | 24%
|
|================= | 24%
|
|================= | 25%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 26%
|
|=================== | 27%
|
|=================== | 28%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 29%
|
|===================== | 30%
|
|===================== | 31%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 32%
|
|======================= | 33%
|
|======================= | 34%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 35%
|
|========================= | 36%
|
|========================== | 36%
|
|========================== | 37%
|
|========================== | 38%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 39%
|
|============================ | 40%
|
|============================ | 41%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 42%
|
|============================== | 43%
|
|============================== | 44%
|
|=============================== | 44%
|
|=============================== | 45%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 46%
|
|================================= | 47%
|
|================================= | 48%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 49%
|
|=================================== | 50%
|
|=================================== | 51%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 52%
|
|===================================== | 53%
|
|===================================== | 54%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 55%
|
|======================================= | 56%
|
|======================================== | 56%
|
|======================================== | 57%
|
|======================================== | 58%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 59%
|
|========================================== | 60%
|
|========================================== | 61%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 62%
|
|============================================ | 63%
|
|============================================ | 64%
|
|============================================= | 64%
|
|============================================= | 65%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 66%
|
|=============================================== | 67%
|
|=============================================== | 68%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 69%
|
|================================================= | 70%
|
|================================================= | 71%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 72%
|
|=================================================== | 73%
|
|=================================================== | 74%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 76%
|
|====================================================== | 77%
|
|====================================================== | 78%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 79%
|
|======================================================== | 80%
|
|======================================================== | 81%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 82%
|
|========================================================== | 83%
|
|========================================================== | 84%
|
|=========================================================== | 84%
|
|=========================================================== | 85%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 86%
|
|============================================================= | 87%
|
|============================================================= | 88%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 89%
|
|=============================================================== | 90%
|
|=============================================================== | 91%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 92%
|
|================================================================= | 93%
|
|================================================================= | 94%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 96%
|
|==================================================================== | 97%
|
|==================================================================== | 98%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 99%
|
|======================================================================| 100%
#>
#> ========================================
#> Treatment rankings
#> ========================================
#>
#> auc ranking
#>
#> |Treatment | Mean| Median| 2.5%| 97.5%|
#> |:---------|----:|------:|----:|-----:|
#> |placebo | 3.00| 3| 3| 3|
#> |alog_6.25 | 1.94| 2| 1| 2|
#> |alog_12.5 | 1.06| 1| 1| 2|
#>
#>
# }