rank.mbnma {MBNMAdose} | R 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 |
lower_better |
Indicates whether negative responses are better ( |
level |
Can be set to |
to.rank |
A numeric vector containing the codes for the agents/classes you wish to rank.
If left |
... |
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)