rank.mb.predict {MBNMAtime} | R Documentation |
Rank predictions at a specific time point
Description
Rank predictions at a specific time point
Usage
## S3 method for class 'mb.predict'
rank(
x,
time = max(x$summary[[1]]$time),
lower_better = FALSE,
treats = names(x$summary),
...
)
Arguments
x |
an object of |
time |
a number indicating the time point at which predictions should be ranked. It must
be one of the time points for which predictions in |
lower_better |
Indicates whether negative responses are better ( |
treats |
A character vector of treatment/class names for which responses have been predicted
in |
... |
Arguments to be passed to methods |
Value
Returns an object of class("mb.rank")
containing ranked predictions
Examples
# Create an mb.network object from a dataset
network <- mb.network(osteopain)
# Run an MBNMA model with an Emax time-course
emax <- mb.run(network,
fun=temax(pool.emax="rel", method.emax="common",
pool.et50="abs", method.et50="common"))
# Predict responses using a stochastic baseline (E0) and a distribution for the
#network reference treatment
preds <- predict(emax, E0=7,
ref.resp=list(emax=~rnorm(n, -0.5, 0.05)))
# Rank predictions at latest predicted time-point
rank(preds, lower_better=TRUE)
#### Rank predictions at 5 weeks follow-up ####
# First ensure responses are predicted at 5 weeks
preds <- predict(emax, E0=7,
ref.resp=list(emax=~rnorm(n, -0.5, 0.05)),
times=c(0,5,10))
# Rank predictions at 5 weeks follow-up
ranks <- rank(preds, lower_better=TRUE, time=5)
# Plot ranks
plot(ranks)
[Package MBNMAtime version 0.2.4 Index]