rank.mbnma: Rank parameter estimates

View source: R/mbnma-class.R

rank.mbnmaR Documentation

Rank parameter estimates

Description

Only parameters that vary by agent/class can be ranked.

Usage

## S3 method for class 'mbnma'
rank(
  x,
  params = NULL,
  lower_better = TRUE,
  level = "agent",
  to.rank = NULL,
  ...
)

Arguments

x

An object on which to apply the rank method

params

A character vector of named parameters in the model that vary by either agent or class (depending on the value assigned to level). If left as NULL (the default), then ranking will be calculated for all available parameters that vary by agent/class.

lower_better

Indicates whether negative responses are better (TRUE) or positive responses are better (FALSE)

level

Can be set to "agent" to rank across different agents or "class" to rank across different classes.

to.rank

A numeric vector containing the codes for the agents/classes you wish to rank. If left NULL then all agents/classes (depending on the value assigned to level) in the model will be ranked. Included codes must be greater than 2 if placebo has been modelled, since placebo cannot be included in the ranking

...

Arguments to be passed to methods

Details

Ranking cannot currently be performed on non-parametric dose-response MBNMA

Value

An object of class("mbnma.rank") which is a list containing a summary data frame, a matrix of rankings for each MCMC iteration, a matrix of probabilities that each agent has a particular rank, and a matrix of cumulative ranking probabilities for each agent, for each parameter that has been ranked.

Examples


# Using the triptans data
network <- mbnma.network(triptans)

# Rank selected agents from a log-linear dose-response MBNMA
loglin <- mbnma.run(network, fun=dloglin())
ranks <- rank(loglin, to.rank=c("zolmitriptan", "eletriptan", "sumatriptan"))
summary(ranks)

# Rank only ED50 parameters from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
ranks <- rank(emax, params="ed50")
summary(ranks)


#### Ranking by class ####
# Generate some classes for the data
class.df <- triptans
class.df$class <- ifelse(class.df$agent=="placebo", "placebo", "active1")
class.df$class <- ifelse(class.df$agent=="eletriptan", "active2", class.df$class)
netclass <- mbnma.network(class.df)
emax <- mbnma.run(netclass, fun=demax(), method="random",
            class.effect=list("ed50"="common"))

# Rank by class, with negative responses being worse
ranks <- rank(emax, level="class", lower_better=FALSE)
print(ranks)

# Print and generate summary data frame for `mbnma.rank` object
summary(ranks)
print(ranks)

# Plot `mbnma.rank` object
plot(ranks)



MBNMAdose documentation built on Aug. 8, 2023, 5:11 p.m.