plot.mbnma.rank {MBNMAdose} | R Documentation |
Plot histograms of rankings from MBNMA models
Description
Plot histograms of rankings from MBNMA models
Usage
## S3 method for class 'mbnma.rank'
plot(x, params = NULL, treat.labs = NULL, ...)
Arguments
x |
An object of class |
params |
A character vector of named parameters in the model that vary by either agent
or class (depending on the value assigned to |
treat.labs |
A vector of treatment labels in the same order as treatment codes.
Easiest to use treatment labels stored by |
... |
Arguments to be sent to |
Value
A series of histograms that show rankings for each treatment/agent/prediction, with a
separate panel for each parameter.
The object returned is a list containing a separate element for each parameter in params
which is an object of class(c("gg", "ggplot"))
.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Estimate rankings from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
ranks <- rank(emax)
# Plot rankings for both dose-response parameters (in two separate plots)
plot(ranks)
# Plot rankings just for ED50
plot(ranks, params="ed50")
# Plot rankings from prediction
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)
plot(rank)
# Trying to plot a parameter that has not been ranked will return an error
#### ERROR ####
# plot(ranks, params="not.a.parameter")