rank.mbnma: Rank parameters from a time-course MBNMA

View source: R/mbnma-class.R

rank.mbnmaR Documentation

Rank parameters from a time-course MBNMA

Description

Ranks desired parameters saved from a time-course MBNMA model from "best" to "worst".

Usage

## S3 method for class '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 in params). Must be a positive integer. Default is the value used in mbnma.

...

Arguments to be sent to integrate()

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.

Value

A named list whose elements include:

  • summary.rank A data frame containing mean, sd, and quantiles for the ranks of each treatment given in treats

  • prob.matrix A matrix of the proportions of MCMC results for which each treatment/class in treats ranked in which position for the given parameter

  • rank.matrix A matrix of the ranks of MCMC results for each treatment/class in treats for the given parameter.

Examples


# Create an mb.network object from a dataset
network <- mb.network(alog_pcfb)

# 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)

# Rank treatments by time-course parameter from the model with lower scores being better
rank(emax, param=c("emax"), lower_better=TRUE)

# Rank treatments 1-3 by AUC
rank(emax, param="auc", treats=c(1:3), lower_better=TRUE,
  int.range=c(0,20))



MBNMAtime documentation built on Oct. 14, 2023, 5:08 p.m.