Type: | Package |
Title: | Dose-Response MBNMA Models |
Version: | 0.5.0 |
Language: | en-GB |
Date: | 2025-02-06 |
URL: | https://hugaped.github.io/MBNMAdose/ |
Maintainer: | Hugo Pedder <hugopedder@gmail.com> |
Description: | Fits Bayesian dose-response model-based network meta-analysis (MBNMA) that incorporate multiple doses within an agent by modelling different dose-response functions, as described by Mawdsley et al. (2016) <doi:10.1002/psp4.12091>. By modelling dose-response relationships this can connect networks of evidence that might otherwise be disconnected, and can improve precision on treatment estimates. Several common dose-response functions are provided; others may be added by the user. Various characteristics and assumptions can be flexibly added to the models, such as shared class effects. The consistency of direct and indirect evidence in the network can be assessed using unrelated mean effects models and/or by node-splitting at the treatment level. |
License: | GPL-3 |
Depends: | R (≥ 3.0.2) |
Imports: | grDevices, stats, graphics, utils, scales, dplyr (≥ 0.7.4), R2jags (≥ 0.5-7), rjags (≥ 4-8), magrittr (≥ 1.5), checkmate (≥ 1.8.5), Rdpack (≥ 0.11-0), igraph (≥ 2.0.1.1), ggplot2 (≥ 2.2.1), reshape2 (≥ 1.4.3) |
Suggests: | overlapping (≥ 1.5.0), RColorBrewer (≥ 1.1-2), mcmcplots (≥ 0.4.3), coda (≥ 0.19-4), testthat (≥ 1.0.2), crayon (≥ 1.3.4), forestplot (≥ 1.10), ggdist (≥ 2.4.0), zoo (≥ 1.8-8), lspline (≥ 1.0-0), formatR (≥ 1.14), netmeta, knitr, rmarkdown |
SystemRequirements: | JAGS (>= 4.3.0) (https://mcmc-jags.sourceforge.net/) |
Encoding: | UTF-8 |
LazyData: | true |
VignetteBuilder: | knitr |
RoxygenNote: | 7.2.3 |
RdMacros: | Rdpack |
NeedsCompilation: | no |
Packaged: | 2025-02-06 19:58:33 UTC; hp17602 |
Author: | Hugo Pedder |
Repository: | CRAN |
Date/Publication: | 2025-02-07 00:40:23 UTC |
MBNMAdose for dose-response Model-Based Network Meta-Analysis
Description
MBNMAdose
provides a collection of useful commands that allow users to run dose-response
Model-Based Network Meta-Analyses (MBNMA).
Introduction
MBNMAdose
allows meta-analysis of studies that compare multiple doses of different agents in a way that can
account for the dose-response relationship.
Whilst making use of all the available evidence in a statistically robust and biologically plausible framework, this also can help connect networks at the agent level that may otherwise be disconnected at the dose/treatment level, and help improve precision of estimates (Pedder et al. 2021). The modelling framework is based on synthesising relative effects which avoids the necessity to adjust for baseline predictors, thereby making fewer assumptions than in typical Model-Based Meta-Analysis.
By modelling the dose-response, MBNMA avoids heterogeneity and inconsistency that can arise from "lumping" different doses together (a technique sometimes done in Network Meta-Analysis). All models and analyses are implemented in a Bayesian framework, following an extension of the standard NMA methodology presented by Lu and Ades (2004) and are run in (). For full details of dose-response MBNMA methodology see Mawdsley et al. (2016). Within this package we refer to a treatment as a specific dose or a specific agent.
Workflow
Functions within MBNMAdose
follow a clear pattern of use:
Load your data into the correct format using
mbnma.network()
Analyse your data using
mbnma.run()
with a wide range of dose-response functionsExamine model results using forest plots and treatment rankings
Check model fit and test for consistency using functions like
mbnma.nodesplit()
Use your model to predict responses using
predict()
At each of these stages there are a number of informative plots that can be generated to help understand the data and to make decisions regarding model fitting.
Author(s)
Maintainer: Hugo Pedder hugopedder@gmail.com (ORCID)
Other contributors:
Adil Karim [contributor]
References
(2017).
https://mcmc-jags.sourceforge.io/.
Lu G, Ades AE (2004).
“Combination of direct and indirect evidence in mixed treatment comparisons.”
Stat Med, 23(20), 3105-24.
ISSN 0277-6715 (Print) 0277-6715 (Linking), doi:10.1002/sim.1875, https://pubmed.ncbi.nlm.nih.gov/15449338/.
Mawdsley D, Bennetts M, Dias S, Boucher M, Welton NJ (2016).
“Model-Based Network Meta-Analysis: A Framework for Evidence Synthesis of Clinical Trial Data.”
CPT Pharmacometrics Syst Pharmacol, 5(8), 393-401.
ISSN 2163-8306 (Electronic) 2163-8306 (Linking), doi:10.1002/psp4.12091, https://pubmed.ncbi.nlm.nih.gov/27479782/.
Pedder H, Dias S, Bennetts M, Boucher M, Welton NJ (2021).
“Joining the dots: Linking disconnected networks of evidence using dose-response Model-Based Network Meta-Analysis.”
Medical Decision Making, 41(2), 194-208.
See Also
Useful links:
Examples
# Generate an "mbnma.network" object that stores data in the correct format
network <- mbnma.network(triptans)
# Generate a network plot at the dose/treatment level
plot(network, level="treatment")
# Generate a network plot at the agent level
plot(network, level="agent", remove.loops=TRUE)
# Perform "split" NMA to examine dose-response relationship
nma <- nma.run(network)
plot(nma)
# Analyse data using mbnma.run() with an Emax dose-response function
# and common treatment effects
result <- mbnma.run(network, fun=demax(),
method="common")
# Generate forest plots for model results
plot(result)
# Rank results and plot rankograms
ranks <- rank(result)
plot(ranks, params="emax")
# Predict responses
pred <- predict(result, E0=0.2)
# Plot predicted response with "split" NMA results displayed
plot(pred, overlay.split=TRUE)
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
Adds placebo comparisons for dose-response relationship
Description
Function adds additional rows to a data.frame of comparisons in a network that account for the relationship between placebo and other agents via the dose-response relationship.
Usage
DR.comparisons(data.ab, level = "treatment", doselink = NULL)
Arguments
data.ab |
A data frame stored in an |
level |
A character that can take either |
doselink |
If given an integer value it indicates that connections via the dose-response
relationship with placebo should be plotted. The integer represents the minimum number of doses
from which a dose-response function could be estimated and is equivalent to the number of
parameters in the desired dose-response function plus one. If left as |
Add arm indices and agent identifiers to a dataset
Description
Adds arm indices (arms
, narms
) to a dataset and adds numeric identifiers for
agent and class (if included in the data).
Usage
add_index(data.ab, agents = NULL, treatments = NULL)
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
agents |
A character string of agent names used to force a particular agent ordering.
Default is |
treatments |
A character string of treatment names used to force a particular treatment ordering.
Default is |
Value
A data frame similar to data.ab
but with additional columns:
-
arm
Arm identifiers coded for each study -
narm
The total number of arms in each study
If agent
or class
are non-numeric or non-sequential (i.e. with missing numeric codes),
agents/classes in the returned data frame will be numbered and recoded to enforce sequential
numbering (a warning will be shown stating this).
Studies of alogliptin for lowering blood glucose concentration in patients with type II diabetes
Description
A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing different doses of alogliptin with placebo (Langford et al. 2016). The systematic review was simply performed and was intended to provide data to illustrate a statistical methodology rather than for clinical inference. Alogliptin is a treatment aimed at reducing blood glucose concentration in type II diabetes. The outcome is continuous, and aggregate data responses correspond to the mean change in HbA1c from baseline to follow-up in studies of at least 12 weeks follow-up. The dataset includes 14 Randomised-Controlled Trials (RCTs), comparing 5 different doses of alogliptin with placebo, leading to 6 different treatments (combination of dose and agent) within the network.
Usage
alog_pcfb
Format
A data frame in long format (one row per arm and study), with 46 rows and 6 variables:
-
studyID
Study identifiers -
agent
Character data indicating the agent to which participants were randomised -
dose
Numeric data indicating the standardised dose received -
y
Numeric data indicating the mean change from baseline in blood glucose concentration (mg/dL) in a study arm -
se
Numeric data indicating the standard error for the mean change from baseline in blood glucose concentration (mg/dL) in a study arm -
n
Numeric data indicating the number of participants randomised
Details
alog_pcfb
is a data frame in long format (one row per arm and study), with the variables studyID
, agent
, dose
, y
, se
, and N
.
References
Langford O, Aronson JK, van Valkenhoef G, Stevens RJ (2016). “Methods for meta-analysis of pharmacodynamic dose-response data with application to multi-arm studies of alogliptin.” Stat Methods Med Res. ISSN 1477-0334 (Electronic) 0962-2802 (Linking), doi:10.1177/0962280216637093.
Calculates values for EDx from an Emax model, the dose at which x% of the maximal response (Emax) is reached
Description
Calculates values for EDx from an Emax model, the dose at which x% of the maximal response (Emax) is reached
Usage
calc.edx(mbnma, x = 50)
Arguments
mbnma |
An S3 object of class |
x |
A numeric value between 0 and 100 for the dose at which x% of the maximal response (Emax) should be calculated |
Value
A data frame of posterior EDx summary values for each agent
Check if all nodes in the network are connected (identical to function in MBNMAtime
)
Description
Check if all nodes in the network are connected (identical to function in MBNMAtime
)
Usage
check.network(g, reference = 1)
Arguments
g |
An network plot of |
reference |
A numeric value indicating which treatment code to use as the reference treatment for testing that all other treatments connect to it |
Plot cumulative ranking curves from MBNMA models
Description
Plot cumulative ranking curves from MBNMA models
Usage
cumrank(x, params = NULL, sucra = TRUE, ...)
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 |
sucra |
A logical object to indicate whether Surface Under Cumulative Ranking Curve (SUCRA) values should be calculated and returned as a data frame. Areas calculated using trapezoid approach. |
... |
Arguments to be sent to |
Value
Line plots showing the cumulative ranking probabilities for each agent/class and
dose-response parameter in x
. The object returned is a list which contains the plot
(an object of class(c("gg", "ggplot")
) and a data frame of SUCRA values
if sucra = TRUE
.
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 cumulative rankings for both dose-response parameters simultaneously
# Note that SUCRA values are also returned
cumrank(ranks)
Sets default priors for JAGS model code
Description
This function creates JAGS code snippets for default MBNMA model priors.
Usage
default.priors(
fun = dloglin(),
UME = FALSE,
regress.mat = NULL,
regress.effect = "common",
om = list(rel = 5, abs = 10)
)
Arguments
fun |
An object of |
UME |
A boolean object to indicate whether to fit an Unrelated Mean Effects model that does not assume consistency and so can be used to test if the consistency assumption is valid. |
regress.mat |
A Nstudy x Ncovariate design matrix of meta-regression covariates |
regress.effect |
Indicates whether effect modification should be assumed to be
|
om |
a list with two elements that report the maximum relative ( |
Value
A list, each element of which is a named JAGS snippet corresponding to a prior in the MBNMA JAGS code.
Examples
default.priors(fun=demax())
Emax dose-response function
Description
Emax dose-response function
Usage
demax(emax = "rel", ed50 = "rel", hill = NULL, p.expon = FALSE)
Arguments
emax |
Pooling for Emax parameter. Can take |
ed50 |
Pooling for ED50 parameter. Can take |
hill |
Pooling for Hill parameter. Can take |
p.expon |
A logical object to indicate whether |
Details
Emax represents the maximum response. exp(ED50) represents the dose at which 50% of the maximum response is achieved. exp(Hill) is the Hill parameter, which allows for a sigmoidal function.
Without Hill parameter:
\frac{E_{max}\times{x}}{ET_{50}+x}
With Hill parameter:
\frac{E_{max}\times{x^{hill}}}{ET_{50}\times{hill}}+x^{hill}
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
# Model without a Hill parameter
demax(emax="rel", ed50="common")
# Model including a Hill parameter and defaults for Emax and ED50 parameters
demax(hill="common")
Dev-dev plot for comparing deviance contributions from two models
Description
Plots the deviances of two model types for comparison. Often used to assess consistency by comparing consistency (NMA or MBNMA) and unrelated mean effects (UME) models (see Pedder et al. (2021)). Models must be run on the same set of data or the deviance comparisons will not be valid.
Usage
devdev(mod1, mod2, dev.type = "resdev", n.iter = 2000, n.thin = 1, ...)
Arguments
mod1 |
First model for which to plot deviance contributions |
mod2 |
Second model for which to plot deviance contributions |
dev.type |
STILL IN DEVELOPMENT FOR MBNMAdose! Deviances to plot - can be either residual
deviances ( |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.thin |
thinning rate. Must be a positive integer. Set
|
... |
Arguments to be sent to |
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an poorly fitting linear dose-response
lin <- mbnma.run(network, fun=dpoly(degree=1))
# Run a better fitting Emax dose-response
emax <- mbnma.run(network, fun=demax())
# Run a standard NMA with unrelated mean effects (UME)
ume <- nma.run(network, UME=TRUE)
# Compare residual deviance contributions from linear and Emax
devdev(lin, emax) # Suggests model fit is very different
# Compare deviance contributions from Emax and UME
devdev(emax, ume) # Suggests model fit is similar
Plot deviance contributions from an MBNMA model
Description
Plot deviance contributions from an MBNMA model
Usage
devplot(
mbnma,
plot.type = "box",
facet = TRUE,
dev.type = "resdev",
n.iter = mbnma$BUGSoutput$n.iter/2,
n.thin = mbnma$BUGSoutput$n.thin,
...
)
Arguments
mbnma |
An S3 object of class |
plot.type |
Deviances can be plotted either as scatter points ( |
facet |
A boolean object that indicates whether or not to facet (by agent for |
dev.type |
STILL IN DEVELOPMENT FOR MBNMAdose! Deviances to plot - can be either residual
deviances ( |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.thin |
thinning rate. Must be a positive integer. Set
|
... |
Arguments to be sent to |
Details
Deviances should only be plotted for models that have converged successfully. If deviance
contributions have not been monitored in mbnma$parameters.to.save
then additional
iterations will have to be run to get results for these.
For MBNMAtime
, deviance contributions cannot be calculated for models with a multivariate likelihood (i.e.
those that account for correlation between observations) because the covariance matrix in these
models is treated as unknown (if rho = "estimate"
) and deviance contributions will be correlated.
Value
Generates a plot of deviance contributions and returns a list containing the
plot (as an object of class(c("gg", "ggplot"))
), and a data.frame of posterior mean
deviance/residual deviance contributions for each observation.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA and predict responses
emax <- mbnma.run(network, fun=demax(), method="random")
# Plot deviances
devplot(emax)
# Plot deviances using boxplots
devplot(emax, plot.type="box")
# Plot deviances on a single scatter plot (not facetted by agent)
devplot(emax, facet=FALSE, plot.type="scatter")
# A data frame of deviance contributions can be obtained from the object
#returned by `devplot`
devs <- devplot(emax)
head(devs$dev.data)
# Other deviance contributions not currently implemented but in future
#it will be possible to plot them like so
#devplot(emax, dev.type="dev")
Exponential dose-response function
Description
Similar parameterisation to the Emax model but with non-asymptotic maximal effect (Emax). Can fit a 1-parameter (Emax only) or 2-parameter model (includes onset parameter that controls the curvature of the dose-response relationship)
Usage
dexp(emax = "rel", onset = NULL, p.expon = FALSE)
Arguments
emax |
Pooling for Emax parameter. Can take |
onset |
Pooling for onset parameter. Can take |
p.expon |
A logical object to indicate whether |
Details
1-parameter model:
emax\times{(1-exp(-x))}
2-parameter model:
emax\times{(1-exp(onset*-x))}
where emax is the maximum efficacy of an agent and rate is the speed
Dose-response parameter arguments:
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
Value
An object of class("dosefun")
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
# Single parameter exponential function is default
dexp()
# Two parameter exponential function
dexp(onset="rel")
Fractional polynomial dose-response function
Description
Fractional polynomial dose-response function
Usage
dfpoly(degree = 1, beta.1 = "rel", beta.2 = "rel", power.1 = 0, power.2 = 0)
Arguments
degree |
The degree of the fractional polynomial as defined in Royston and Altman (1994) |
beta.1 |
Pooling for the 1st fractional polynomial coefficient. Can take |
beta.2 |
Pooling for the 2nd fractional polynomial coefficient. Can take |
power.1 |
Value for the 1st fractional polynomial power ( |
power.2 |
Value for the 2nd fractional polynomial power ( |
Details
-
\beta_1
represents the 1st coefficient. -
\beta_2
represents the 2nd coefficient. -
\gamma_1
represents the 1st fractional polynomial power -
\gamma_2
represents the 2nd fractional polynomial power
For a polynomial of degree=1
:
{\beta_1}x^{\gamma_1}
For a polynomial of degree=2
:
{\beta_1}x^{\gamma_1}+{\beta_2}x^{\gamma_2}
x^{\gamma}
is a regular power except where \gamma=0
, where x^{(0)}=ln(x)
.
If a fractional polynomial power \gamma
repeats within the function it is multiplied by another ln(x)
.
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
Royston P, Altman D (1994). “Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling.” Journal of the Royal Statistical Society: Series C, 43(3), 429-467.
Examples
# 1st order fractional polynomial a value of 0.5 for the power
dfpoly(beta.1="rel", power.1=0.5)
# 2nd order fractional polynomial with relative effects for coefficients
# and a value of -0.5 and 2 for the 1st and 2nd powers respectively
dfpoly(degree=2, beta.1="rel", beta.2="rel",
power.1=-0.5, power.2=2)
Integrated Two-Component Prediction (ITP) function
Description
Similar parameterisation to the Emax model but with non-asymptotic maximal effect (Emax). Proposed by proposed by Fu and Manner (2010)
Usage
ditp(emax = "rel", rate = "rel", p.expon = FALSE)
Arguments
emax |
Pooling for Emax parameter. Can take |
rate |
Pooling for Rate parameter. Can take |
p.expon |
A logical object to indicate whether |
Details
Emax represents the maximum response. Rate represents the rate at which a change in the dose of the drug leads to a change in the effect
{E_{max}}\times\frac{(1-exp(-{rate}\times{x}))}{(1-exp(-{rate}\times{max(x)}))}
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
Fu H, Manner D (2010). “Bayesian adaptive dose-finding studies with delayed responses.” J Biopharm Stat, 20(5), 1055-1070. doi:10.1080/10543400903315740.
Examples
# Model a common effect on rate
ditp(emax="rel", rate="common")
Log-linear (exponential) dose-response function
Description
Modelled assuming relative effects ("rel"
)
Usage
dloglin()
Details
rate\times{log(x + 1)}
Dose-response parameter arguments:
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
Value
An object of class("dosefun")
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
dloglin()
Agent-specific dose-response function
Description
Function combines different dose-response functions together to create an object containing parameters for multiple dose-response functions.
Usage
dmulti(funs = list())
Arguments
funs |
A list of objects of |
Value
An object of class("dosefun")
Examples
funs <- c(rep(list(demax()),3),
rep(list(dloglin()),2),
rep(list(demax(ed50="common")),3),
rep(list(dexp()),2))
dmulti(funs)
Non-parameteric dose-response functions
Description
Used to fit monotonically increasing non-parametric dose-response relationship following the method of Owen et al. (2015))
Usage
dnonparam(direction = "increasing")
Arguments
direction |
Can take either |
Value
An object of class("dosefun")
References
Owen RK, Tincello DG, Keith RA (2015). “Network meta-analysis: development of a three-level hierarchical modeling approach incorporating dose-related constraints.” Value Health, 18(1), 116-26. ISSN 1524-4733 (Electronic) 1098-3015 (Linking), doi:10.1016/j.jval.2014.10.006, https://pubmed.ncbi.nlm.nih.gov/25595242/.
Examples
# Monotonically increasing dose-response
dnonparam(direction="increasing")
# Monotonically decreasing dose-response
dnonparam(direction="decreasing")
Polynomial dose-response function
Description
Polynomial dose-response function
Usage
dpoly(
degree = 1,
beta.1 = "rel",
beta.2 = "rel",
beta.3 = "rel",
beta.4 = "rel"
)
Arguments
degree |
The degree of the polynomial - e.g. |
beta.1 |
Pooling for the 1st polynomial coefficient. Can take |
beta.2 |
Pooling for the 2nd polynomial coefficient. Can take |
beta.3 |
Pooling for the 3rd polynomial coefficient. Can take |
beta.4 |
Pooling for the 4th polynomial coefficient. Can take |
Details
-
\beta_1
represents the 1st coefficient. -
\beta_2
represents the 2nd coefficient. -
\beta_3
represents the 3rd coefficient. -
\beta_4
represents the 4th coefficient.
Linear model:
\beta_1{x}
Quadratic model:
\beta_1{x} + \beta_2{x^2}
Cubic model:
\beta_1{x} + \beta_2{x^2} + \beta_3{x^3}
Quartic model:
\beta_1{x} + \beta_2{x^2} + \beta_3{x^3} + \beta_4{x^4}
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
# Linear model with random effects
dpoly(beta.1="rel")
# Quadratic model dose-response function
# with an exchangeable (random) absolute parameter estimated for the 2nd coefficient
dpoly(beta.1="rel", beta.2="random")
Drop treatments from multi-arm (>2) studies for node-splitting
Description
Drops arms in a way which preserves connectivity and equally removes data from each treatment in a nodesplit comparison (so as to maximise precision)
Usage
drop.comp(ind.df, drops, comp, start = 1)
Arguments
ind.df |
A data frame in long format (one arm per row) from which to drop treatments |
drops |
A vector of study identifiers from which to drop treatments |
comp |
A numeric vector of length 2 that contains treatment codes corresponding to the comparison for node-splitting |
start |
Can take either |
Drop studies that are not connected to the network reference treatment
Description
Drop studies that are not connected to the network reference treatment
Usage
drop.disconnected(network, connect.dose = FALSE)
Arguments
network |
An object of class |
connect.dose |
A boolean object to indicate whether treatments should be
kept in the network if they connect via the simplest possible dose-response
relationship ( |
Value
A list containing a single row per arm data frame containing only studies that are connected to the network reference treatment, and a character vector of treatment labels
Examples
# Using the triptans headache dataset
network <- mbnma.network(triptans)
drops <- drop.disconnected(network)
# No studies have been dropped since network is fully connected
length(unique(network$data.ab$studyID))==length(unique(drops$data.ab$studyID))
# Make data with no placebo
noplac.df <- network$data.ab[network$data.ab$narm>2 & network$data.ab$agent!=1,]
net.noplac <- mbnma.network(noplac.df)
# Studies are dropped as some only connect via the dose-response function
drops <- drop.disconnected(net.noplac, connect.dose=FALSE)
length(unique(net.noplac$data.ab$studyID))==length(unique(drops$data.ab$studyID))
# Studies are not dropped if they connect via the dose-response function
drops <- drop.disconnected(net.noplac, connect.dose=TRUE)
length(unique(net.noplac$data.ab$studyID))==length(unique(drops$data.ab$studyID))
Spline dose-response functions
Description
Used to fit B-splines, natural cubic splines, and piecewise linear splines(Perperoglu et al. 2019).
Usage
dspline(
type = "bs",
knots = 1,
degree = 1,
beta.1 = "rel",
beta.2 = "rel",
beta.3 = "rel",
beta.4 = "rel",
beta.5 = "rel",
beta.6 = "rel"
)
Arguments
type |
The type of spline. Can take |
knots |
The number/location of spline internal knots. If a single number is given it indicates the number of knots (they will be equally spaced across the range of doses for each agent). If a numeric vector is given it indicates the location of the knots. |
degree |
The degree of the piecewise B-spline polynomial - e.g. |
beta.1 |
Pooling for the 1st coefficient. Can take |
beta.2 |
Pooling for the 2nd coefficient. Can take |
beta.3 |
Pooling for the 3rd coefficient. Can take |
beta.4 |
Pooling for the 4th coefficient. Can take |
beta.5 |
Pooling for the 5th coefficient. Can take |
beta.6 |
Pooling for the 6th coefficient. Can take |
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
Perperoglu A, Sauerbrei W, Abrahamowicz M, Schmid M (2019). “A review of spline function procedures in R.” BMC Medical Research Methodology, 19(46), 1-16. doi:10.1186/s12874-019-0666-3.
Examples
# Second order B spline with 2 knots and random effects on the 2nd coefficient
dspline(type="bs", knots=2, degree=2,
beta.1="rel", beta.2="rel")
# Piecewise linear spline with knots at 0.1 and 0.5 quantiles
# Single parameter independent of treatment estimated for 1st coefficient
#with random effects
dspline(type="ls", knots=c(0.1,0.5),
beta.1="random", beta.2="rel")
User-defined dose-response function
Description
User-defined dose-response function
Usage
duser(fun, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel")
Arguments
fun |
A formula specifying any relationship including |
beta.1 |
Pooling for the 1st coefficient. Can take |
beta.2 |
Pooling for the 2nd coefficient. Can take |
beta.3 |
Pooling for the 3rd coefficient. Can take |
beta.4 |
Pooling for the 4th coefficient. Can take |
Value
An object of class("dosefun")
Dose-response parameters
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mbnma.run()
.
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
dr <- ~ beta.1 * (1/(dose+1)) + beta.2 * dose^2
duser(fun=dr,
beta.1="common", beta.2="rel")
Plot fitted values from MBNMA model
Description
Plot fitted values from MBNMA model
Usage
fitplot(
mbnma,
disp.obs = TRUE,
n.iter = mbnma$BUGSoutput$n.iter,
n.thin = mbnma$BUGSoutput$n.thin,
...
)
Arguments
mbnma |
An S3 object of class |
disp.obs |
A boolean object to indicate whether raw data responses should be plotted as points on the graph |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.thin |
thinning rate. Must be a positive integer. Set
|
... |
Arguments to be sent to |
Details
Fitted values should only be plotted for models that have converged successfully.
If fitted values (theta
) have not been monitored in mbnma$parameters.to.save
then additional iterations will have to be run to get results for these.
Value
Generates a plot of fitted values from the MBNMA model and returns a list containing
the plot (as an object of class(c("gg", "ggplot"))
), and a data.frame of posterior mean
fitted values for each observation.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA and predict responses
emax <- mbnma.run(network, fun=demax(), method="random")
# Plot fitted values and observed values
fitplot(emax)
# Plot fitted values only
fitplot(emax, disp.obs=FALSE)
# A data frame of fitted values can be obtained from the object
#returned by `fitplot`
fits <- fitplot(emax)
head(fits$fv)
Automatically generate parameters to save for a dose-response MBNMA model
Description
Automatically generate parameters to save for a dose-response MBNMA model
Usage
gen.parameters.to.save(fun, model, regress.mat = NULL)
Arguments
fun |
An object of |
model |
A JAGS model written as a character object |
regress.mat |
A Nstudy x Ncovariate design matrix of meta-regression covariates |
Generates spline basis matrices for fitting to dose-response function
Description
Generates spline basis matrices for fitting to dose-response function
Usage
genspline(
x,
spline = "bs",
knots = 1,
degree = 1,
max.dose = max(x),
boundaries = NULL
)
Arguments
x |
A numeric vector indicating all time points available in the dataset |
spline |
Indicates the type of spline function. Can be either a piecewise linear spline ( |
knots |
The number/location of internal knots. If a single integer is given it indicates the number of knots (they will
be equally spaced across the range of doses for each agent). If a numeric vector is given it indicates the quantiles of the knots as
a proportion of the maximum dose in the dataset. For example, if the maximum dose in the dataset
is 100mg/d, |
degree |
a positive integer giving the degree of the polynomial from which the spline function is composed
(e.g. |
max.dose |
A number indicating the maximum dose between which to calculate the spline function. |
boundaries |
A positive numeric vector of length 2 that represents the doses at which to anchor the B-spline or natural
cubic spline basis matrix. This allows data to extend beyond the boundary knots, or for the basis parameters to not depend on |
Value
A spline basis matrix with number of rows equal to length(x)
and the number of columns equal to the number
of coefficients in the spline.
Examples
x <- 0:100
genspline(x)
# Generate a quadratic B-spline with 1 equally spaced internal knot
genspline(x, spline="bs", knots=2, degree=2)
# Generate a natural cubic spline with 3 knots at selected quantiles
genspline(x, spline="ns", knots=c(0.1, 0.5, 0.7))
# Generate a piecewise linear spline with 3 equally spaced knots
genspline(x, spline="ls", knots=3)
Get current priors from JAGS model code
Description
Identical to get.prior()
in MBNMAtime
package.
This function takes JAGS model presented as a string and identifies what
prior values have been used for calculation.
Usage
get.prior(model)
Arguments
model |
A character object of JAGS MBNMA model code |
Details
Even if an MBNMA model that has not initialised successfully and
results have not been calculated, the JAGS model for it is saved in
mbnma$model.arg$jagscode
and therefore priors can still be obtained.
This allows for priors to be changed even in failing models, which may help
solve issues with compiling or updating.
Value
A character vector, each element of which is a line of JAGS code corresponding to a prior in the JAGS code.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA
result <- mbnma.run(network, fun=demax(), method="random")
# Obtain model prior values
print(result$model.arg$priors)
# Priors when using mbnma.run with an exponential function
result <- mbnma.run(network, fun=dexp(), method="random")
print(result$model.arg$priors)
Calculates league table of effects between treatments in MBNMA and/or NMA models
Description
Calculates league table of effects between treatments in MBNMA and/or NMA models
Usage
get.relative(
lower.diag,
upper.diag = lower.diag,
treatments = list(),
lower.direction = "colvrow",
upper.direction = "rowvcol",
regress.vals = NULL,
eform = FALSE,
lim = "cred"
)
Arguments
lower.diag |
An S3 object either of class |
upper.diag |
Same as for |
treatments |
A list whose elements each represent different treatments.
Treatment is defined as a combination of agent and dose. Only agents specified in
|
lower.direction |
Whether treatment effects should be presented as the column versus the row treatment
for each cell in the lower-left diagonal of the league table ( |
upper.direction |
Same as for |
regress.vals |
A named numeric vector of effect modifier values at which relative effects
should be estimated. Named elements must match variable names specified in regression design matrix
( |
eform |
Whether outputted results should be presented in their exponential form (e.g. for models with log or logit link functions) |
lim |
Specifies calculation of either 95% credible intervals ( |
Value
An array of length(treatments) x length(treatments) x nsims
, where nsims
is the number of iterations monitored in lower.diag
. The array contains the individual
MCMC values for each relative effect calculated between all treatments
on the link scale
specified in the lower.diag
and upper.diag
models.
Examples
# Using the osteoarthritis data
network <- mbnma.network(osteopain)
# Run an MBNMA model
expon <- mbnma.run(network, fun=dexp(), method="random")
# Calculate relative effects for MBNMA between:
# Celebrex 100mg/d, Celebrex 200mg/d, Tramadol 100mg/d
rel.eff <- get.relative(lower.diag=expon,
treatments=list("Celebrex"=c(100,200), "Tramadol"=100))
# Run an NMA model
nma <- nma.run(network, method="random")
# Compare results between MBNMA and NMA models
rel.eff <- get.relative(lower.diag=expon, upper.diag=nma,
treatments=list("Celebrex"=c(100,200), "Tramadol"=100),
upper.direction="colvrow")
Prepares data for JAGS
Description
Converts MBNMA data frame to a list for use in JAGS model
Usage
getjagsdata(
data.ab,
class = FALSE,
sdscale = FALSE,
regress = NULL,
regress.effect = "common",
likelihood = check.likelink(data.ab)$likelihood,
link = check.likelink(data.ab)$link,
level = "agent",
fun = NULL,
nodesplit = NULL
)
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
class |
A boolean object indicating whether or not |
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
regress |
A formula of effect modifiers (variables that
interact with the treatment effect) to incorporate using Network Meta-Regression
(E.g. |
regress.effect |
Indicates whether effect modification should be assumed to be
|
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
level |
Can take either |
fun |
An object of |
nodesplit |
A numeric vector of length 2 containing treatment codes on which to perform
an MBNMA nodesplit (see |
Value
A named list of numbers, vector, matrices and arrays to be sent to JAGS. List elements are:
If
likelihood="normal"
:-
y
An array of mean responses for each arm within each study -
se
An array of standard errors for each arm within each study
-
If
likelihood="binomial"
:-
r
An array of the number of responses/count for each each arm within each study -
n
An array of the number of participants for each arm within each study
-
If
likelihood="poisson"
:-
r
An array of the number of responses/count for each each arm within each study -
E
An array of the total exposure time for each arm within each study
-
-
dose
A matrix of doses for each arm within each study (iflevel="agent"
) -
narm
A numeric vector with the number of arms per study -
NS
The total number of studies in the dataset -
Nagent
The total number of agents in the dataset (iflevel="agent"
) -
agent
A matrix of agent codes within each study (iflevel="agent"
) -
NT
The total number of treatment in the dataset (iflevel="treatment"
) -
treatment
A matrix of treatment codes within each study (iflevel="treatment"
) -
Nclass
Optional. The total number of classes in the dataset -
class
Optional. A matrix of class codes within each study -
classkey
Optional. A vector of class codes that correspond to agent codes. Same length as the number of agent codes. -
split.ind
Optional. A matrix indicating whether a specific arm contributes evidence to a nodesplit comparison.
Examples
# Using the triptans headache dataset
network <- mbnma.network(triptans)
jagsdat <- getjagsdata(network$data.ab, likelihood="binomial", link="logit")
# Get JAGS data with class
netclass <- mbnma.network(osteopain)
jagsdat <- getjagsdata(netclass$data.ab, class=TRUE)
# Get JAGS data at the treatment level for split Network Meta-Analysis
network <- mbnma.network(triptans)
jagsdat <- getjagsdata(network$data.ab, level="treatment")
Studies of treatments for Serum Uric Acid reduction in patients with gout
Description
A dataset from a systematic review of interventions for lowering Serum Uric Acid (SUA) concentration in patients with gout (not published previously). The outcome is continuous, and aggregate data responses correspond to the mean change from baseline in SUA in mg/dL at 2 weeks follow-up. The dataset includes 10 Randomised-Controlled Trials (RCTs), comparing 5 different agents, and placebo. Data for one agent (RDEA) arises from an RCT that is not placebo-controlled, and so is not connected to the network directly. In total there were 19 different treatments (combination of dose and agent).
Usage
gout
Format
A data frame in long format (one row per arm and study), with 27 rows and 5 variables:
-
studyID
Study identifiers -
y
Numeric data indicating the mean change from baseline in SUA in a study arm -
se
Numeric data indicating the standard error for the mean change from baseline in SUA in a study arm -
agent
Character data indicating the agent to which participants were randomised -
dose
Numeric data indicating the standardised dose received
Source
Pfizer Ltd.
Identify comparisons in loops that fulfill criteria for node-splitting
Description
Identify comparisons informed by both direct and indirect evidence from independent sources, which therefore fulfill the criteria for testing for inconsistency via node-splitting.
Usage
inconsistency.loops(df, checkindirect = TRUE, incldr = FALSE)
Arguments
df |
A data frame containing variables |
checkindirect |
A boolean object to indicate whether or not to perform an additional
check to ensure network remains connected even after dropping direct evidence on a comparison.
Default is |
incldr |
A boolean object indicating whether or not to allow for indirect evidence contributions via the dose-response relationship. This can be used when node-splitting in dose-response MBNMA to allow for a greater number of potential loops in which to check for consistency. |
Details
Similar to gemtc::mtc.nodesplit.comparisons()
but uses a fixed
reference treatment and therefore identifies fewer loops in which to test for
inconsistency. Heterogeneity can also be parameterised as inconsistency and
so testing for inconsistency in additional loops whilst changing the
reference treatment would also be identifying heterogeneity. Depends on
igraph
.
Value
A data frame of comparisons that are informed by direct and indirect
evidence from independent sources. Each row of the data frame is a
different treatment comparison. Numerical codes in t1
and t2
correspond
to treatment codes. path
indicates the treatment codes that connect the
shortest path of indirect evidence.
If incldr=TRUE
then path
may indicate doseresp
for some comparisons.
These are comparisons for which indirect evidence is only available via the
dose-response relationship. The two numbers given after (e.g. 3 2
) indicate the
number of doses available in the indirect evidence with which to estimate the
dose-response function for the treatments in t1
and t2
respectively/
References
There are no references for Rd macro \insertAllCites
on this help page.
Examples
# Identify comparisons informed by direct and indirect evidence
#in triptans dataset
network <- mbnma.network(triptans)
inconsistency.loops(network$data.ab)
# Include indirect evidence via dose-response relationship
inconsistency.loops(network$data.ab, incldr=TRUE)
# Do not perform additional connectivity check on data
data <- data.frame(studyID=c(1,1,2,2,3,3,4,4,5,5,5),
treatment=c(1,2,1,3,2,3,3,4,1,2,4)
)
inconsistency.loops(data, checkindirect=FALSE)
Identify unique comparisons within a network
Description
Identify unique contrasts within a network that make up all the head-to-head comparisons. Repetitions of the same treatment comparison are grouped together.
Usage
mbnma.comparisons(df)
Arguments
df |
A data frame containing variables |
Value
A data frame of unique comparisons in which each row represents a different comparison.
t1
and t2
indicate the treatment codes that make up the comparison. nr
indicates the number
of times the given comparison is made within the network.
If there is only a single follow-up observation for each study within the dataset (i.e. as for standard
network meta-analysis) nr
will represent the number of studies that compare treatments t1
and
t2
.
If there are multiple observations for each study within the dataset (as in time-course MBNMA)
nr
will represent the number of time points in the dataset in which treatments t1
and t2
are
compared.
Examples
df <- data.frame(studyID=c(1,1,2,2,3,3,4,4,5,5,5),
treatment=c(1,2,1,3,2,3,3,4,1,2,4)
)
# Identify unique comparisons within the data
mbnma.comparisons(df)
# Using the triptans headache dataset
network <- mbnma.network(triptans) # Adds treatment identifiers
mbnma.comparisons(network$data.ab)
Node-splitting model for testing consistency at the treatment level using MBNMA
Description
Splits contributions for a given set of treatment comparisons into direct and indirect evidence. A discrepancy between the two suggests that the consistency assumption required for NMA and MBNMA may violated.
Usage
mbnma.nodesplit(
network,
fun = dpoly(degree = 1),
method = "common",
comparisons = NULL,
incldr = TRUE,
...
)
## S3 method for class 'nodesplit'
plot(x, plot.type = "forest", ...)
Arguments
network |
An object of class |
fun |
An object of |
method |
Can take either |
comparisons |
A matrix specifying the comparisons to be split (one row per comparison).
The matrix must have two columns indicating each treatment for each comparison. Values can
either be character (corresponding to the treatment names given in |
incldr |
A boolean object indicating whether or not to allow for indirect evidence contributions via the dose-response relationship. This can be used when node-splitting in dose-response MBNMA to allow for a greater number of potential loops in which to check for consistency. |
... |
Arguments to be sent to |
x |
An object of |
plot.type |
A character string that can take the value of |
Details
The S3 method plot()
on an nodesplit
object generates either
forest plots of posterior medians and 95\% credible intervals, or density plots
of posterior densities for direct and indirect evidence.
Value
Plots the desired graph if plot.type="forest"
and plots and returns an object
of class(c("gg", "ggplot"))
if plot.type="density"
.
Functions
-
plot(nodesplit)
: Plot outputs from treatment-level nodesplit MBNMA models
Examples
# Using the triptans data
network <- mbnma.network(triptans)
split <- mbnma.nodesplit(network, fun=demax(), likelihood = "binomial", link="logit",
method="common")
#### To perform nodesplit on selected comparisons ####
# Check for closed loops of treatments with independent evidence sources
# Including indirect evidence via the dose-response relationship
loops <- inconsistency.loops(network$data.ab, incldr=TRUE)
# This...
single.split <- mbnma.nodesplit(network, fun=dexp(), likelihood = "binomial", link="logit",
method="random", comparisons=rbind(c("sumatriptan_1", "almotriptan_1")))
#...is the same as...
single.split <- mbnma.nodesplit(network, fun=dexp(), likelihood = "binomial", link="logit",
method="random", comparisons=rbind(c(6, 12)))
# Plot results
plot(split, plot.type="density") # Plot density plots of posterior densities
plot(split, txt_gp=forestplot::fpTxtGp(cex=0.5)) # Plot forest plots (with smaller label size)
# Print and summarise results
print(split)
summary(split) # Generate a data frame of summary results
Run MBNMA dose-response models
Description
Fits a Bayesian dose-response for model-based network meta-analysis (MBNMA) that can account for multiple doses of different agents by applying a desired dose-response function. Follows the methods of Mawdsley et al. (2016).
Usage
mbnma.run(
network,
fun = dpoly(degree = 1),
method = "common",
regress = NULL,
regress.effect = "common",
class.effect = list(),
UME = FALSE,
sdscale = FALSE,
cor = FALSE,
omega = NULL,
parameters.to.save = NULL,
pD = TRUE,
likelihood = NULL,
link = NULL,
priors = NULL,
n.iter = 20000,
n.chains = 3,
n.burnin = floor(n.iter/2),
n.thin = max(1, floor((n.iter - n.burnin)/1000)),
autojags = FALSE,
Rhat = 1.05,
n.update = 10,
model.file = NULL,
jagsdata = NULL,
...
)
Arguments
network |
An object of class |
fun |
An object of |
method |
Can take either |
regress |
A formula of effect modifiers (variables that
interact with the treatment effect) to incorporate using Network Meta-Regression
(E.g. |
regress.effect |
Indicates whether effect modification should be assumed to be
|
class.effect |
A list of named strings that determines which dose-response
parameters to model with a class effect and what that effect should be
( |
UME |
A boolean object to indicate whether to fit an Unrelated Mean Effects model that does not assume consistency and so can be used to test if the consistency assumption is valid. |
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
cor |
A boolean object that indicates whether correlation should be modelled
between relative effect dose-response parameters. This is
automatically set to |
omega |
A scale matrix for the inverse-Wishart prior for the covariance matrix used
to model the correlation between dose-response parameters (see Details for dose-response functions). |
parameters.to.save |
A character vector containing names of parameters to monitor in JAGS |
pD |
logical; if |
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
priors |
A named list of parameter values (without indices) and replacement prior distribution values given as strings using distributions as specified in JAGS syntax (see Plummer (2017)). Note that normal distributions in JAGS are specified as
, where
. |
n.iter |
number of total iterations per chain (including burn in; default: 20000) |
n.chains |
number of Markov chains (default: 3) |
n.burnin |
length of burn in, i.e. number of iterations to discard at the beginning. Default is 'n.iter/2“, that is, discarding the first half of the simulations. If n.burnin is 0, jags() will run 100 iterations for adaption. |
n.thin |
thinning rate. Must be a positive integer. Set |
autojags |
A boolean value that indicates whether the model should be continually updated until
it has converged below a specific cutoff of |
Rhat |
A cutoff value for the Gelman-Rubin convergence diagnostic(Gelman and Rubin 1992).
Unless all parameters have Rhat values lower than this the model will continue to sequentially update up
to a maximum of |
n.update |
The maximum number of updates. Each update is run for 1000 iterations, after which the
Rhat values of all parameters are checked against |
model.file |
The file path to a JAGS model (.jags file) that can be used
to overwrite the JAGS model that is automatically written based on the
specified options in |
jagsdata |
A named list of the data objects to be used in the JAGS model. Only
required if users are defining their own JAGS model using |
... |
Arguments to be sent to R2jags. |
Details
When relative effects are modelled on more than one dose-response parameter and
cor = TRUE
, correlation between the dose-response parameters is automatically
estimated using a vague Wishart prior. This prior can be made slightly more informative
by specifying the relative scale of variances between the dose-response parameters using
omega
. cor
will automatically be set to FALSE
if class effects are modelled.
Value
An object of S3 class(c("mbnma", "rjags"))
containing parameter
results from the model. Can be summarized by print()
and can check
traceplots using R2jags::traceplot()
or various functions from the package mcmcplots
.
Nodes that are automatically monitored (if present in the model) have the following interpretation:
Parameters(s)/Parameter Prefix | Interpretation |
<named dose-response parameter> (e.g. emax ) | The pooled effect for each dose-response parameter, as defined in dose-response functions. Will vary by agent if pooling is specified as "rel" in the dose-response function. |
sd | The between-study SD (heterogeneity) for relative effects, reported if method="random" |
sd.<named dose-response parameter> (e.g. sd.emax ) | Between-study SD (heterogeneity) for absolute dose-response parameters specified as "random" . |
<named capitalized dose-response parameter> (e.g. EMAX ) | The class effect within each class for a given dose-response parameter. These will be estimated by the model if specified in class.effects for a given dose-response parameter. |
sd.<named capitalized dose-response parameter> (e.g. sd.EMAX ) | The within-class SD for different agents within the same class. Will be estimated by the model if any dose-response parameter in class.effect is set to "random" . |
totresdev | The residual deviance of the model |
deviance | The deviance of the model |
If there are errors in the JAGS model code then the object will be a list
consisting of two elements - an error message from JAGS that can help with
debugging and model.arg
, a list of arguments provided to mbnma.run()
which includes jagscode
, the JAGS code for the model that can help
users identify the source of the error.
Dose-response parameter arguments
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
Dose-response function
Several general dose-response functions are provided, but a user-defined dose-response relationship can instead be used.
As of version 0.4.0 dose-response functions are specified as an object of class("dosefun")
. See
help details for each of the functions below for the interpretation of specific dose-response parameters.
Built-in dose-response functions are:
-
dpoly()
: polynomial (e.g. for a linear model -dpoly(degree=1)
) -
dloglin()
: log-linear -
dexp()
: exponential -
demax()
: (emax with/without a Hill parameter) -
dspline()
: splines (can fit B-splines (type="bs"
), restricted cubic splines (type="rcs"
), natural splines (type="ns"
), or piecewise linear splines (type="ls"
)) -
dfpoly()
: fractional polynomials -
dnonparam()
: Non-parametric monotonic function (direction
can be either"increasing"
or"decreasing"
) following the method of Owen et al. (2015) -
duser()
: user-defined function -
dmulti()
: allows agent-specific dose-response functions to be fitted. A separate function must be provided for each agent in the network.
References
Gelman A, Rubin DB (1992).
“Inference from iterative simulation using multiple sequences.”
Statistical Science, 7(4), 457-511.
https://projecteuclid.org/journals/statistical-science/volume-7/issue-4/Inference-from-Iterative-Simulation-Using-Multiple-Sequences/10.1214/ss/1177011136.full.
Mawdsley D, Bennetts M, Dias S, Boucher M, Welton NJ (2016).
“Model-Based Network Meta-Analysis: A Framework for Evidence Synthesis of Clinical Trial Data.”
CPT Pharmacometrics Syst Pharmacol, 5(8), 393-401.
ISSN 2163-8306 (Electronic) 2163-8306 (Linking), doi:10.1002/psp4.12091, https://pubmed.ncbi.nlm.nih.gov/27479782/.
Owen RK, Tincello DG, Keith RA (2015).
“Network meta-analysis: development of a three-level hierarchical modeling approach incorporating dose-related constraints.”
Value Health, 18(1), 116-26.
ISSN 1524-4733 (Electronic) 1098-3015 (Linking), doi:10.1016/j.jval.2014.10.006, https://pubmed.ncbi.nlm.nih.gov/25595242/.
Plummer M (2008).
“Penalized loss functions for Bayesian model comparison.”
Biostatistics, 9(3), 523-39.
ISSN 1468-4357 (Electronic) 1465-4644 (Linking), https://pubmed.ncbi.nlm.nih.gov/18209015/.
Plummer M (2017).
JAGS user manual.
https://people.stat.sc.edu/hansont/stat740/jags_user_manual.pdf.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
######## Dose-response functions ########
# Fit a dose-response MBNMA with a linear function
# with common treatment effects
result <- mbnma.run(network, fun=dpoly(degree=1), method="common")
# Fit a dose-response MBNMA with a log-linear function
# with random treatment effects
result <- mbnma.run(network, fun=dloglin(), method="random")
# Fit a dose-response MBNMA with a fractional polynomial function
# with random treatment effects
# with a probit link function
result <- mbnma.run(network, fun=dfpoly(), method="random", link="probit")
# Fit a user-defined function (quadratic)
fun.def <- ~ (beta.1 * dose) + (beta.2 * (dose^2))
result <- mbnma.run(network, fun=duser(fun=fun.def), method="common")
# Fit an Emax function
# with a single random (exchangeable) parameter for ED50
# with common treatment effects
result <- mbnma.run(network, fun=demax(emax="rel", ed50="random"),
method="common")
# Fit an Emax function with a Hill parameter
# with a fixed value of 5 for the Hill parameter
# with random relative effects
result <- mbnma.run(network, fun=demax(hill=5), method="random")
# Fit a model with natural cubic splines
# with 3 knots at 10% 30% and 60% quartiles of dose ranges
depnet <- mbnma.network(ssri) # Using the sSRI depression dataset
result <- mbnma.run(depnet, fun=dspline(type="ns", knots=c(0.1,0.3,0.6)))
# Fit a model with different dose-response functions for each agent
multifun <- dmulti(list(dloglin(), # for placebo (can be any function)
demax(), # for eletriptan
demax(), # for sumatriptan
dloglin(), # for frovatriptan
demax(), # for almotriptan
demax(), # for zolmitriptan
dloglin(), # for naratriptan
demax())) # for rizatriptan
multidose <- mbnma.run(network, fun=multifun)
########## Class effects ##########
# Using the osteoarthritis dataset
pain.df <- osteopain
# Set a shared class (NSAID) only for Naproxcinod and Naproxen
pain.df <- pain.df %>% dplyr::mutate(
class = dplyr::case_when(agent %in% c("Naproxcinod", "Naproxen") ~ "NSAID",
!agent %in% c("Naproxcinod", "Naproxen") ~ agent
)
)
# Run an Emax MBNMA with a common class effect on emax
painnet <- mbnma.network(pain.df)
result <- mbnma.run(painnet, fun = demax(),
class.effect = list(emax = "common"))
####### Priors #######
# Obtain priors from a fractional polynomial function
result <- mbnma.run(network, fun=dfpoly(degree=1), method="random")
print(result$model.arg$priors)
# Change the prior distribution for the power
newpriors <- list(power.1 = "dnorm(0,0.001) T(0,)")
newpriors <- list(sd = "dnorm(0,0.5) T(0,)")
result <- mbnma.run(network, fun=dfpoly(degree=1), method="random",
priors=newpriors)
########## Sampler options ##########
# Change the number of MCMC iterations, the number of chains, and the thin
result <- mbnma.run(network, fun=dloglin(), method="random",
n.iter=5000, n.thin=5, n.chains=4)
####### Examine MCMC diagnostics (using mcmcplots or coda packages) #######
# Density plots
mcmcplots::denplot(result)
# Traceplots
mcmcplots::traplot(result)
# Caterpillar plots
mcmcplots::caterplot(result, "rate")
# Autocorrelation plots (using the coda package)
coda::autocorr.plot(coda::as.mcmc(result))
####### Automatically run jags until convergence is reached #########
# Rhat of 1.08 is set as the criteria for convergence
#on all monitored parameters
conv.res <- mbnma.run(network, fun=demax(),
method="random",
n.iter=10000, n.burnin=9000,
autojags=TRUE, Rhat=1.08, n.update=8)
########## Output ###########
# Print R2jags output and summary
print(result)
summary(result)
# Plot forest plot of results
plot(result)
Update MBNMA to monitor deviance nodes in the model
Description
Useful for obtaining deviance contributions or fitted values. Same function used in MBNMAdose and MBNMAtime packages.
Usage
mbnma.update(
mbnma,
param = "theta",
armdat = TRUE,
n.iter = mbnma$BUGSoutput$n.iter,
n.thin = mbnma$BUGSoutput$n.thin
)
Arguments
mbnma |
An S3 object of class |
param |
Used to indicate which node to monitor in the model. Can be any parameter in the model code that varies by all arms within all studies. These are some typical parameters that it might be of interest to monitor, provided they are in the original model code:
|
armdat |
Include raw arm-level data for each data point (agent, dose, study grouping) |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.thin |
thinning rate. Must be a positive integer. Set
|
Value
A data frame containing the posterior mean of the updates by arm and study, with arm and study identifiers.
For MBNMAdose:
-
facet
indicates the agent identifier in the given arm of a study -
fupdose
indicates the dose in the given arm of a study
For MBNMAtime:
-
facet
indicates the treatment identifier in the given arm of the study -
fupdose
indicates the follow-up time at the given observation in the given arm of the study
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Fit a dose-response MBNMA, monitoring "psi" and "resdev"
result <- mbnma.run(network, fun=dloglin(), method="random",
parameters.to.save=c("psi", "resdev"))
mbnma.update(result, param="theta") # monitor theta
mbnma.update(result, param="rhat") # monitor rhat
mbnma.update(result, param="delta") # monitor delta
Validates that a dataset fulfills requirements for MBNMA
Description
Validates that a dataset fulfills requirements for MBNMA
Usage
mbnma.validate.data(data.ab, single.arm = FALSE)
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
single.arm |
A boolean object to indicate whether to allow single arm studies in the dataset ( |
Details
Checks done within the validation:
Checks data.ab has required column names
Checks there are no NAs
Checks that all SEs are >0 (if variables are included in dataset)
Checks that all doses are >=0
Checks that all r and n are positive (if variables are included in dataset)
Checks that all y, se, r, n and E are numeric
Checks that class codes are consistent within each agent
Checks that agent/class names do not contain restricted characters
Checks that studies have at least two arms (if
single.arm = FALSE
)Checks that each study includes at least two treatments
Checks that agent names do not include underscores
Checks that standsd values are consistent within a study
Value
An error if checks are not passed. Runs silently if checks are passed
Write MBNMA dose-response model JAGS code
Description
Writes JAGS code for a Bayesian time-course model for model-based network meta-analysis (MBNMA).
Usage
mbnma.write(
fun = dpoly(degree = 1),
method = "common",
regress.mat = NULL,
regress.effect = "common",
sdscale = FALSE,
cor = FALSE,
cor.prior = "wishart",
omega = NULL,
om = list(rel = 5, abs = 10),
class.effect = list(),
UME = FALSE,
likelihood = "binomial",
link = NULL
)
Arguments
fun |
An object of |
method |
Can take either |
regress.mat |
A Nstudy x Ncovariate design matrix of meta-regression covariates |
regress.effect |
Indicates whether effect modification should be assumed to be
|
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
cor |
A boolean object that indicates whether correlation should be modelled
between relative effect dose-response parameters. This is
automatically set to |
cor.prior |
NOT CURRENTLY IN USE - indicates the prior distribution to use for the correlation/covariance
between relative effects. Must be kept as |
omega |
A scale matrix for the inverse-Wishart prior for the covariance matrix used
to model the correlation between dose-response parameters (see Details for dose-response functions). |
om |
a list with two elements that report the maximum relative ( |
class.effect |
A list of named strings that determines which dose-response
parameters to model with a class effect and what that effect should be
( |
UME |
A boolean object to indicate whether to fit an Unrelated Mean Effects model that does not assume consistency and so can be used to test if the consistency assumption is valid. |
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
Details
When relative effects are modelled on more than one dose-response parameter and
cor = TRUE
, correlation between the dose-response parameters is automatically
estimated using a vague Wishart prior. This prior can be made slightly more informative
by specifying the relative scale of variances between the dose-response parameters using
omega
. cor
will automatically be set to FALSE
if class effects are modelled.
Value
A single long character string containing the JAGS model generated based on the arguments passed to the function.
Examples
# Write model code for a model with an exponential dose-response function,
# with random treatment effects
model <- mbnma.write(fun=dexp(),
method="random",
likelihood="binomial",
link="logit"
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax with a random effects model,
# a single parameter estimated for ED50 with a common effects model
model <- mbnma.write(fun=demax(emax="rel", ed50="common"),
likelihood="normal",
link="identity"
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax and ED50.
# Class effects modelled on ED50 with common effects
model <- mbnma.write(fun=demax(),
likelihood="normal",
link="identity",
class.effect=list("ed50"="common")
)
names(model) <- NULL
print(model)
# Write model code for a model with an Emax dose-response function,
# relative effects modelled on Emax and ED50 with a
# random effects model that automatically models a correlation between
# both parameters.
model <- mbnma.write(fun=demax(),
method="random",
likelihood="normal",
link="identity",
)
names(model) <- NULL
print(model)
Node-splitting model for testing consistency at the treatment-level
Description
Splits contributions for a given set of treatment comparisons into direct and indirect evidence. A discrepancy between the two suggests that the consistency assumption required for NMA (and subsequently MBNMA) may violated.
Usage
nma.nodesplit(
network,
likelihood = NULL,
link = NULL,
method = "common",
comparisons = NULL,
drop.discon = TRUE,
...
)
## S3 method for class 'nma.nodesplit'
plot(x, plot.type = NULL, ...)
Arguments
network |
An object of class |
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
method |
Can take either |
comparisons |
A matrix specifying the comparisons to be split (one row per comparison).
The matrix must have two columns indicating each treatment for each comparison. Values can
either be character (corresponding to the treatment names given in |
drop.discon |
A boolean object that indicates whether to drop treatments
that are disconnected at the treatment level. Default is |
... |
Arguments to be sent to |
x |
An object of |
plot.type |
A character string that can take the value of |
Details
The S3 method plot()
on an nma.nodesplit
object generates either
forest plots of posterior medians and 95\% credible intervals, or density plots
of posterior densities for direct and indirect evidence.
Value
Plots the desired graph(s) and returns an object (or list of object if
plot.type=NULL
) of class(c("gg", "ggplot"))
Methods (by generic)
-
plot(nma.nodesplit)
: Plot outputs from treatment-level nodesplit models
Examples
# Using the triptans data
network <- mbnma.network(triptans)
split <- nma.nodesplit(network, likelihood = "binomial", link="logit",
method="common")
#### To perform nodesplit on selected comparisons ####
# Check for closed loops of treatments with independent evidence sources
loops <- inconsistency.loops(network$data.ab)
# This...
single.split <- nma.nodesplit(network, likelihood = "binomial", link="logit",
method="random", comparisons=rbind(c("sumatriptan_1", "almotriptan_1")))
#...is the same as...
single.split <- nma.nodesplit(network, likelihood = "binomial", link="logit",
method="random", comparisons=rbind(c(6, 12)))
# Plot results
plot(split, plot.type="density") # Plot density plots of posterior densities
plot(split, plot.type="forest") # Plot forest plots of direct and indirect evidence
# Print and summarise results
print(split)
summary(split) # Generate a data frame of summary results
Convert normal distribution parameters to corresponding log-normal distribution parameters
Description
Converts mean and variance of normal distribution to the parameters for a log-normal distribution with the same mean and variance
Usage
norm2lnorm(m, v)
Arguments
m |
Mean of the normal distribution |
v |
Variance of the normal distribution |
Value
A vector of length two. The first element is the mean and the second element is the variance of the log-normal distribution
Examples
norm <- rnorm(1000, mean=5, sd=2)
params <- norm2lnorm(5, 2^2)
lnorm <- rlnorm(1000, meanlog=params[1], sdlog=params[2]^0.5)
# Mean and SD of lnorm is equivalent to mean and sd of norm
mean(lnorm)
sd(lnorm)
Studies of treatments for pain relief in patients with osteoarthritis
Description
A dataset from a systematic review of interventions for pain relief in osteoarthritis, used previously in Pedder et al. (2019). The outcome is continuous, and aggregate data responses correspond to the mean WOMAC pain score at 2 weeks follow-up. The dataset includes 18 Randomised-Controlled Trials (RCTs), comparing 8 different agents with placebo. In total there were 26 different treatments (combination of dose and agent). The active treatments can also be grouped into 3 different classes, within which they have similar mechanisms of action.
Usage
osteopain
Format
A data frame in long format (one row per arm and study), with 74 rows and 7 variables:
-
studyID
Study identifiers -
agent
Character data indicating the agent to which participants were randomised -
dose
Numeric data indicating the standardised dose received -
class
Character data indicating the drug class to which the agent belongs to -
y
Numeric data indicating the mean pain score on the WOMAC scale in a study arm -
se
Numeric data indicating the standard error for the mean pain score on the WOMAC scale in a study arm -
n
Numeric data indicating the number of participants randomised
Source
Pfizer Ltd.
References
Pedder H, Dias S, Bennetts M, Boucher M, Welton NJ (2019). “Modelling time-course relationships with multiple treatments: Model-Based Network Meta-Analysis for continuous summary outcomes.” Res Synth Methods, 10(2), 267-286.
Calculate plugin pD from a JAGS model with univariate likelihood for studies with repeated measurements
Description
Uses results from MBNMA JAGS models to calculate pD via the plugin method (Spiegelhalter et al. 2002). Can only be used for models with known standard errors or covariance matrices. Currently only functions with univariate likelihoods. Function is identical in MBNMAdose and MBNMAtime packages.
Usage
pDcalc(
obs1,
obs2,
fups = NULL,
narm,
NS,
theta.result,
resdev.result,
likelihood = "normal",
type = "time"
)
Arguments
obs1 |
A matrix (study x arm) or array (study x arm x time point) containing
observed data for |
obs2 |
A matrix (study x arm) or array (study x arm x time point) containing
observed data for |
fups |
A numeric vector of length equal to the number of studies,
containing the number of follow-up mean responses reported in each study. Required for
time-course MBNMA models (if |
narm |
A numeric vector of length equal to the number of studies, containing the number of arms in each study. |
NS |
A single number equal to the number of studies in the dataset. |
theta.result |
A matrix (study x arm) or array (study x arm x time point) containing the posterior mean predicted means/probabilities/rate in each arm of each study. This will be estimated by the JAGS model. |
resdev.result |
A matrix (study x arm) or array (study x arm x time point) containing the posterior mean residual deviance contributions in each arm of each study. This will be estimated by the JAGS model. |
likelihood |
A character object of any of the following likelihoods:
|
type |
The type of MBNMA model fitted. Can be either |
Details
Method for calculating pD via the plugin method proposed by
Spiegelhalter (Spiegelhalter et al. 2002). Standard errors / covariance matrices must be assumed
to be known. To obtain values for theta.result
and resdev.result
these
parameters must be monitored when running the MBNMA model (using parameters.to.save
).
For non-linear time-course MBNMA models residual deviance contributions may be skewed, which can lead to non-sensical results when calculating pD via the plugin method. Alternative approaches are to use pV as an approximation or pD calculated by Kullback-Leibler divergence (Plummer 2008).
Value
A single numeric value for pD calculated via the plugin method.
References
Plummer M (2008).
“Penalized loss functions for Bayesian model comparison.”
Biostatistics, 9(3), 523-39.
ISSN 1468-4357 (Electronic) 1465-4644 (Linking), https://pubmed.ncbi.nlm.nih.gov/18209015/.
Spiegelhalter DJ, Best NG, Carlin BP, van der Linde A (2002).
“Bayesian measures of model complexity and fit.”
J R Statistic Soc B, 64(4), 583-639.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Fit a dose-response MBNMA, monitoring "psi" and "resdev"
result <- mbnma.run(network, fun=dloglin(), method="random",
parameters.to.save=c("psi", "resdev"))
#### Calculate pD for binomial data ####
# Prepare data for pD calculation
r <- result$model$data()$r
n <- result$model$data()$n
narm <- result$model$data()$narm
NS <- result$model$data()$NS
psi <- result$BUGSoutput$median$psi
resdevs <- result$BUGSoutput$median$resdev
# Calculate pD via plugin method
pD <- pDcalc(obs1=r, obs2=n, narm=narm, NS=NS,
theta.result=psi, resdev.result=resdevs,
likelihood="binomial", type="dose")
Forest plot for results from dose-response MBNMA models
Description
Generates a forest plot for dose-response parameters.
Usage
## S3 method for class 'mbnma'
plot(x, params = NULL, ...)
Arguments
x |
An S3 object of class |
params |
A character vector of dose-response parameters to plot.
Parameters must be given the same name as monitored nodes in |
... |
Arguments to be passed to methods, such as graphical parameters |
Value
A forest plot of class c("gg", "ggplot")
that has separate panels for
different dose-response parameters. Results are plotted on the link scale.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an exponential dose-response MBNMA and generate the forest plot
exponential <- mbnma.run(network, fun=dexp())
plot(exponential)
# Plot only Emax parameters from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
plot(emax, params=c("emax"))
#### Forest plots including class effects ####
# 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"))
Create an mbnma.network object
Description
Creates an object of class("mbnma.network")
. Various MBNMA functions can subsequently be applied
to this object.
Usage
## S3 method for class 'mbnma.network'
plot(
x,
level = "treatment",
v.color = "connect",
doselink = NULL,
layout = igraph::in_circle(),
remove.loops = FALSE,
edge.scale = 1,
v.scale = NULL,
label.distance = 0,
legend = TRUE,
legend.x = "bottomleft",
legend.y = NULL,
...
)
mbnma.network(data.ab, description = "Network")
Arguments
x |
An object of class |
level |
A string indicating whether nodes/facets should represent |
v.color |
Can take either |
doselink |
If given an integer value it indicates that connections via the dose-response
relationship with placebo should be plotted. The integer represents the minimum number of doses
from which a dose-response function could be estimated and is equivalent to the number of
parameters in the desired dose-response function plus one. If left as |
layout |
An igraph layout specification. This is a function specifying an igraph
layout that determines the arrangement of the vertices (nodes). The default
|
remove.loops |
A boolean value indicating whether to include loops that indicate comparisons within a node. |
edge.scale |
A number to scale the thickness of connecting lines (edges). Line thickness is proportional to the number of studies for a given comparison. Set to 0 to make thickness equal for all comparisons. |
v.scale |
A number with which to scale the size of the nodes. If the variable |
label.distance |
A number scaling the distance of labels from the nodes
to improve readability. The labels will be directly on top of the nodes if
the default of 0 is used. Option only applicable if |
legend |
A boolean object to indicate whether or not to plot a legend to indicate which node colour
corresponds to which agent if |
legend.x , legend.y |
The x and y co-ordinates to be used to position the legend. They can be specified
by keyword or in any way which is accepted by |
... |
Options for plotting in |
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
description |
Optional. Short description of the network. |
Details
The S3 method plot()
on an mbnma.network
object generates a
network plot that shows how different treatments are connected within the
network via study comparisons. This can be used to identify how direct and
indirect evidence are informing different treatment comparisons. Depends on
igraph
.
Agents/classes for arms that have dose = 0 will be relabelled as "Placebo"
.
Missing values (NA
) cannot be included in the dataset. Single arm studies cannot
be included.
Value
plot()
: An object of class("igraph")
- any functions from the igraph
package
can be applied to this object to change its characteristics.
mbnma.network()
: An object of class("mbnma.network")
which is a list containing:
-
description
A short description of the network -
data.ab
A data frame containing the arm-level network data (treatment identifiers will have been recoded to a sequential numeric code) -
studyID
A character vector with the IDs of included studies -
agents
A character vector indicating the agent identifiers that correspond to the new agent codes. -
treatments
A character vector indicating the treatment identifiers that correspond to the new treatment codes. -
classes
A character vector indicating the class identifiers (if included in the original data) that correspond to the new class codes.
Methods (by generic)
-
plot(mbnma.network)
: Generate a network plot
Examples
# Create an mbnma.network object from the data
network <- mbnma.network(triptans)
# Generate a network plot from the data
plot(network)
# Generate a network plot at the agent level that removes loops indicating comparisons
#within a node
plot(network, level="agent", remove.loops=TRUE)
# Generate a network plot at the treatment level that colours nodes by agent
plot(network, v.color="agent", remove.loops=TRUE)
# Generate a network plot that includes connections via the dose-response function
# For a one parameter dose-response function (e.g. exponential)
plot(network, level="treatment", doselink=1, remove.loops=TRUE)
# For a two parameter dose-response function (e.g. Emax)
plot(network, level="treatment", doselink=2, remove.loops=TRUE)
# Arrange network plot in a star with the reference treatment in the centre
plot(network, layout=igraph::as_star(), label.distance=3)
#### Plot a network with no placebo data included ####
# Make data with no placebo
noplac.df <- network$data.ab[network$data.ab$narm>2 & network$data.ab$agent!=1,]
net.noplac <- mbnma.network(noplac.df)
# Plotting network automatically plots connections to Placebo via dose-response
plot(net.noplac)
# Using the triptans headache dataset
print(triptans)
# Define network
network <- mbnma.network(triptans, description="Example network")
summary(network)
plot(network)
Plots predicted responses from a dose-response MBNMA model
Description
Plots predicted responses on the natural scale from a dose-response MBNMA model.
Usage
## S3 method for class 'mbnma.predict'
plot(
x,
disp.obs = FALSE,
overlay.split = FALSE,
method = "common",
agent.labs = NULL,
scales = "free_x",
...
)
Arguments
x |
An object of class |
disp.obs |
A boolean object to indicate whether to show the location of observed doses
in the data on the 95\% credible intervals of the predicted dose-response curves as shaded regions ( |
overlay.split |
A boolean object indicating whether to overlay a line
showing the split (treatment-level) NMA results on the plot ( |
method |
Indicates the type of split (treatment-level) NMA to perform when |
agent.labs |
A character vector of agent labels to display on plots. If
left as |
scales |
Should scales be fixed ( |
... |
Arguments for |
Details
For the S3 method plot()
, it is advisable to ensure predictions in
predict
are estimated using a sufficient number of doses to ensure a smooth
predicted dose-response curve. If disp.obs = TRUE
it is
advisable to ensure predictions in predict
are estimated using an even
sequence of time points to avoid misrepresentation of shaded densities.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA and predict responses
emax <- mbnma.run(network, fun=demax(), method="random")
pred <- predict(emax, E0 = 0.5)
plot(pred)
# Display observed doses on the plot
plot(pred, disp.obs=TRUE)
# Display split NMA results on the plot
plot(pred, overlay.split=TRUE)
# Split NMA results estimated using random treatment effects model
plot(pred, overlay.split=TRUE, method="random")
# Add agent labels
plot(pred, agent.labs=c("Elet", "Suma", "Frov", "Almo", "Zolmi",
"Nara", "Riza"))
# These labels will throw an error because "Placebo" is included in agent.labs when
#it will not be plotted as a separate panel
#### ERROR ####
#plot(pred, agent.labs=c("Placebo", "Elet", "Suma", "Frov", "Almo", "Zolmi",
# "Nara", "Riza"))
# If insufficient predictions are made across dose-response function
# then the plotted responses are less smooth and can be misleading
pred <- predict(emax, E0 = 0.5, n.doses=3)
plot(pred)
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")
Run an NMA model
Description
Used for calculating treatment-level NMA results, either when comparing MBNMA models to models that
make no assumptions regarding dose-response , or to estimate split results for overlay.split
.
Results can also be compared between consistency (UME=FALSE
) and inconsistency
(UME=TRUE
) models to test the validity of the consistency assumption at the treatment-level.
Usage
## S3 method for class 'nma'
plot(x, bydose = TRUE, scales = "free_x", ...)
nma.run(
network,
method = "common",
likelihood = NULL,
link = NULL,
priors = NULL,
sdscale = FALSE,
warn.rhat = TRUE,
n.iter = 20000,
drop.discon = TRUE,
UME = FALSE,
pD = TRUE,
parameters.to.save = NULL,
...
)
Arguments
x |
An object of |
bydose |
A boolean object indicating whether to plot responses with dose
on the x-axis ( |
scales |
Should scales be fixed ( |
... |
Arguments to be sent to |
network |
An object of class |
method |
Indicates the type of split (treatment-level) NMA to perform when |
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
priors |
A named list of parameter values (without indices) and replacement prior distribution values given as strings using distributions as specified in JAGS syntax (see Plummer (2017)). Note that normal distributions in JAGS are specified as
, where
. |
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
warn.rhat |
A boolean object to indicate whether to return a warning if Rhat values for any monitored parameter are >1.02 (suggestive of non-convergence). |
n.iter |
number of total iterations per chain (including burn in; default: 20000) |
drop.discon |
A boolean object that indicates whether or not to drop disconnected studies from the network. |
UME |
A boolean object to indicate whether to fit an Unrelated Mean Effects model that does not assume consistency and so can be used to test if the consistency assumption is valid. |
pD |
logical; if |
parameters.to.save |
A character vector containing names of parameters to monitor in JAGS |
Functions
-
plot(nma)
: Plot outputs from treatment-level NMA modelsResults can be plotted either as a single forest plot, or facetted by agent and plotted with increasing dose in order to identify potential dose-response relationships. If Placebo (or any agents with dose=0) is included in the network then this will be used as the reference treatment, but if it is not then results will be plotted versus the network reference used in the NMA object (
x
).
Examples
# Run random effects NMA on the alogliptin dataset
alognet <- mbnma.network(alog_pcfb)
nma <- nma.run(alognet, method="random")
print(nma)
plot(nma)
# Run common effects NMA keeping treatments that are disconnected in the NMA
goutnet <- mbnma.network(gout)
nma <- nma.run(goutnet, method="common", drop.discon=FALSE)
# Run an Unrelated Mean Effects (UME) inconsistency model on triptans dataset
tripnet <- mbnma.network(triptans)
ume <- nma.run(tripnet, method="random", UME=TRUE)
Predict responses for different doses of agents in a given population based on MBNMA dose-response models
Description
Used to predict responses for different doses of agents or to predict the results of a new study. This is calculated by combining relative treatment effects with a given reference treatment response (specific to the population of interest).
Usage
## S3 method for class 'mbnma'
predict(
object,
n.doses = 30,
exact.doses = NULL,
E0 = 0.2,
synth = "fixed",
lim = "cred",
regress.vals = NULL,
...
)
Arguments
object |
An S3 object of class |
n.doses |
A number indicating the number of doses at which to make predictions
within each agent. The default is |
exact.doses |
A list of numeric vectors. Each named element in the list corresponds to an
agent (either named similarly to agent names given in the data, or named
correspondingly to the codes for agents given in |
E0 |
An object to indicate the value(s) to use for the response at dose = 0 (i.e.
placebo) in the prediction. This can take a number of different formats depending
on how it will be used/calculated. The default is
|
synth |
A character object that can take the value |
lim |
Specifies calculation of either 95% credible intervals ( |
regress.vals |
A named numeric vector of effect modifier values at which results should
be predicted. Named elements must match variable names specified in |
... |
Arguments to be sent to |
Details
The range of doses on which to make predictions can be specified in one of two ways:
Use
max.dose
andn.doses
to specify the maximum dose for each agent and the number of doses within that agent for which to predict responses. Doses will be chosen that are equally spaced from zero to the maximum dose for each agent. This is useful for generating plots of predicted responses (using[plot-mbnma.predict]
) as it will lead to fitting a smooth dose-response curve (providedn.doses
is sufficiently high).Use
exact.doses
to specify the exact doses for which to predict responses for each agent. This may be more useful when ranking different predicted responses using[rank-mbnma.predict]
Value
An S3 object of class mbnma.predict
that contains the following
elements:
-
predicts
A named list of matrices. Each matrix contains the MCMC results of predicted responses at follow-up times specified intimes
for each treatment specified intreats
-
likelihood
The likelihood used in the MBNMA modelobject
-
link
The link function used in the MBNMA modelobject
-
network
The dataset inmbnma.network
format -
E0
A numeric vector of value(s) used for E0 in the prediction, on the link scale.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
###########################
###### Specifying E0 ######
###########################
#### Predict responses using deterministic value for E0 ####
# Data is binomial so we specify E0 on the natural scale as a probability
pred <- predict(emax, E0 = 0.2)
# Specifying non-sensical values will return an error
#pred <- predict(emax, E0 = -10)
### ERROR ###
#### Predict responses using stochastic value for E0 ####
# Data is binomial so we might want to draw from a beta distribution
pred <- predict(emax, E0 = "rbeta(n, shape1=1, shape2=5)")
# Misspecifying the RNG string will return an error
#pred <- predict(emax, E0 = "rbeta(shape1=1, shape2=5)")
### ERROR ###
#### Predict responses using meta-analysis of dose = 0 studies ####
# E0 is assigned a data frame of studies to synthesis
# Can be taken from placebo arms in triptans dataset
ref.df <- network$data.ab[network$data.ab$agent==1,]
# Synthesis can be fixed/random effects
pred <- predict(emax, E0 = ref.df, synth="random")
######################################################################
#### Specifying which doses/agents for which to predict responses ####
######################################################################
# Change the number of predictions for each agent
pred <- predict(emax, E0 = 0.2, n.doses=20)
pred <- predict(emax, E0 = 0.2, n.doses=3)
# Specify several exact combinations of doses and agents to predict
pred <- predict(emax, E0 = 0.2,
exact.doses=list("eletriptan"=c(0:5), "sumatriptan"=c(1,3,5)))
plot(pred) # Plot predictions
# Print and summarise `mbnma.predict` object
print(pred)
summary(pred)
# Plot `mbnma.predict` object
plot(pred)
Print mbnma.network information to the console
Description
Print mbnma.network information to the console
Usage
## S3 method for class 'mbnma.network'
print(x, ...)
Arguments
x |
An object of class |
... |
further arguments passed to or from other methods |
Print summary information from an mbnma.predict object
Description
Print summary information from an mbnma.predict object
Usage
## S3 method for class 'mbnma.predict'
print(x, ...)
Arguments
x |
An object of |
... |
further arguments passed to or from other methods |
Prints summary information about an mbnma.rank object
Description
Prints summary information about an mbnma.rank object
Usage
## S3 method for class 'mbnma.rank'
print(x, ...)
Arguments
x |
An object of class |
... |
further arguments passed to or from other methods |
Prints summary results from an nma.nodesplit object
Description
Prints summary results from an nma.nodesplit object
Usage
## S3 method for class 'nma.nodesplit'
print(x, ...)
Arguments
x |
An object of |
... |
further arguments passed to or from other methods |
Prints summary results from a nodesplit object
Description
Prints summary results from a nodesplit object
Usage
## S3 method for class 'nodesplit'
print(x, ...)
Arguments
x |
An object of |
... |
further arguments passed to or from other methods |
Print posterior medians (95% credible intervals) for table of relative effects/mean differences between treatments/classes
Description
Print posterior medians (95% credible intervals) for table of relative effects/mean differences between treatments/classes
Usage
## S3 method for class 'relative.array'
print(x, digits = 2, ...)
Arguments
x |
An object of class |
digits |
An integer indicating the number of significant digits to be used. |
... |
further arguments passed to |
Studies of biologics for treatment of moderate-to-severe psoriasis (100% improvement)
Description
A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo (Warren et al. 2019). The outcome is the number of patients experiencing 100% improvement on the Psoriasis Area and Severity Index (PASI) measured at 12 weeks follow-up. The dataset includes 19 Randomised-Controlled Trials (RCTs), comparing 8 different biologics at different doses with placebo.
Usage
psoriasis100
Format
A data frame in long format (one row per arm and study), with 81 rows and 9 variables:
-
studyID
Study identifiers -
agent
Character data indicating the agent to which participants were randomised -
dose_mg
Numeric data indicating the dose to which participants were randomised in mg -
freq
Character data indicating the frequency of the dose to which participants were randomised -
dose
Numeric data indicating the dose in mg/week to which the participants were randomised -
n
Numeric data indicating the number of participants randomised -
r
Numeric data indicating the number of participants who achieved 100% improvement in PASI score after 12 weeks
References
Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019). “Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.” J Am Acad Dermatol, 82(5), 1138-1149.
Studies of biologics for treatment of moderate-to-severe psoriasis (>=75% improvement)
Description
A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo (Warren et al. 2019). The outcome is the number of patients experiencing >=75% improvement on the Psoriasis Area and Severity Index (PASI) measured at 12 weeks follow-up. The dataset includes 28 Randomised-Controlled Trials (RCTs), comparing 9 different biologics at different doses with placebo.
Usage
psoriasis75
Format
A data frame in long format (one row per arm and study), with 81 rows and 9 variables:
-
studyID
Study identifiers -
agent
Character data indicating the agent to which participants were randomised -
dose_mg
Numeric data indicating the dose to which participants were randomised in mg -
freq
Character data indicating the frequency of the dose to which participants were randomised -
dose
Numeric data indicating the dose in mg/week to which the participants were randomised -
n
Numeric data indicating the number of participants randomised -
r
Numeric data indicating the number of participants who achieved >=75% improvement in PASI score after 12 weeks
References
Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019). “Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.” J Am Acad Dermatol, 82(5), 1138-1149.
Studies of biologics for treatment of moderate-to-severe psoriasis (>=90% improvement)
Description
A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo (Warren et al. 2019). The outcome is the number of patients experiencing >=90% improvement on the Psoriasis Area and Severity Index (PASI) measured at 12 weeks follow-up. The dataset includes 24 Randomised-Controlled Trials (RCTs), comparing 9 different biologics at different doses with placebo.
Usage
psoriasis90
Format
A data frame in long format (one row per arm and study), with 81 rows and 9 variables:
-
studyID
Study identifiers -
agent
Character data indicating the agent to which participants were randomised -
dose_mg
Numeric data indicating the dose to which participants were randomised in mg -
freq
Character data indicating the frequency of the dose to which participants were randomised -
dose
Numeric data indicating the dose in mg/week to which the participants were randomised -
n
Numeric data indicating the number of participants randomised -
r
Numeric data indicating the number of participants who achieved >=90% improvement in PASI score after 12 weeks
References
Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019). “Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.” J Am Acad Dermatol, 82(5), 1138-1149.
Set rank as a method
Description
Set rank as a method
Usage
rank(x, ...)
Arguments
x |
An object on which to apply the rank method |
... |
Arguments to be passed to methods |
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)
Rank predicted doses of different agents
Description
Ranks predictions at different doses from best to worst.
Usage
## S3 method for class 'mbnma.predict'
rank(x, lower_better = TRUE, rank.doses = NULL, ...)
Arguments
x |
An object on which to apply the rank method |
lower_better |
Indicates whether negative responses are better ( |
rank.doses |
A list of numeric vectors. Each named element corresponds to an
agent (as named/coded in |
... |
Arguments to be passed to methods |
Details
If predict
contains multiple predictions at dose=0, then only the first of these
will be included, to avoid duplicating rankings.
Value
An object of class("mbnma.rank")
which is a list containing a summary data
frame, a matrix of rankings for each MCMC iteration, and a matrix of probabilities
that each agent has a particular rank, for each parameter that has been ranked.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Rank all predictions from a log-linear dose-response MBNMA
loglin <- mbnma.run(network, fun=dloglin())
pred <- predict(loglin, E0 = 0.5)
rank <- rank(pred)
summary(rank)
# Rank selected predictions from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
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,
rank.doses=list("eletriptan"=c(0,2), "rizatriptan"=2))
# Print and generate summary data frame for `mbnma.rank` object
summary(rank)
print(rank)
# Plot `mbnma.rank` object
plot(rank)
Rank relative effects obtained between specific doses
Description
Ranks "relative.table"
objects generated by get.relative()
.
Usage
## S3 method for class 'relative.array'
rank(x, lower_better = TRUE, ...)
Arguments
x |
An object on which to apply the rank method |
lower_better |
Indicates whether negative responses are better ( |
... |
Arguments to be passed to methods |
Value
An object of class("mbnma.rank")
which is a list containing a summary data
frame, a matrix of rankings for each MCMC iteration, and a matrix of probabilities
that each agent has a particular rank, for each parameter that has been ranked.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Rank selected predictions from an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
rels <- get.relative(emax)
rank <- rank(rels, lower_better=TRUE)
# Print and generate summary data frame for `mbnma.rank` object
summary(rank)
print(rank)
# Plot `mbnma.rank` object
plot(rank)
Assigns agent or class variables numeric identifiers
Description
Assigns agent or class variables numeric identifiers
Usage
recode.agent(data.ab, level = "agent")
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
level |
Can take either |
Details
Also relabels the agent for any arms in which dose = 0 to "Placebo_0"
Value
A list containing a data frame with recoded agent/class identifiers and a character vector of original agent/class names
Synthesise single arm dose = 0 / placebo studies to estimate E0
Description
Synthesises single arm studies to estimate E0. Used in predicting responses from a dose-response MBNMA.
Usage
ref.synth(
data.ab,
mbnma,
synth = "fixed",
n.iter = mbnma$BUGSoutput$n.iter,
n.burnin = mbnma$BUGSoutput$n.burnin,
n.thin = mbnma$BUGSoutput$n.thin,
n.chains = mbnma$BUGSoutput$n.chains,
...
)
Arguments
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
mbnma |
An S3 object of class |
synth |
A character object that can take the value |
n.iter |
number of total iterations per chain (including burn in; default: 2000) |
n.burnin |
length of burn in, i.e. number of iterations to
discard at the beginning. Default is |
n.thin |
thinning rate. Must be a positive integer. Set
|
n.chains |
number of Markov chains (default: 3) |
... |
Arguments to be sent to |
Details
data.ab
can be a collection of studies that closely resemble the
population of interest intended for the prediction, which could be
different to those used to estimate the MBNMA model, and could include
single arms of RCTs or observational studies. If other data is not
available, the data used to estimate the MBNMA model can be used by
selecting only the studies and arms that investigate dose = 0 (placebo).
Defaults for n.iter
, n.burnin
, n.thin
and n.chains
are those used to estimate
mbnma
.
Value
A list of named elements corresponding to E0 and the between-study standard deviation for
E0 if synth="random"
. Each element contains the full MCMC results from the synthesis.
Examples
# Using the triptans data
network <- mbnma.network(triptans)
# Run an Emax dose-response MBNMA
emax <- mbnma.run(network, fun=demax(), method="random")
# Data frame for synthesis can be taken from placebo arms
ref.df <- triptans[triptans$agent=="placebo",]
# Meta-analyse placebo studies using fixed treatment effects
E0 <- ref.synth(ref.df, emax, synth="fixed")
names(E0)
# Meta-analyse placebo studies using random treatment effects
E0 <- ref.synth(ref.df, emax, synth="random")
names(E0)
Rescale data depending on the link function provided
Description
Rescale data depending on the link function provided
Usage
rescale.link(x, direction = "link", link = "logit")
Arguments
x |
A numeric vector of data to be rescaled |
direction |
Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
Value
A rescaled numeric vector
Studies of wound closure methods to reduce Surgical Site Infections (SSI)
Description
A dataset from an ongoing systematic review examining the efficacy of different wound closure methods to reduce surgical
site infections (SSI). The outcome is binary and represents the number of patients who experienced a SSI. The dataset
includes 129 RCTs comparing 16 different interventions in 6 classes. This dataset is primarily used to illustrate
how MBNMAdose
can be used to perform different types of network meta-analysis without dose-response information.
Usage
ssi_closure
Format
A data frame in long format (one row per arm and study), with 281 rows and 6 variables:
-
studyID
Study identifiers -
Year
Year of publication -
n
Numeric data indicating the number of participants randomised -
r
Numeric data indicating the number of participants who achieved >50% improvement in depression symptoms -
trt
Treatment names, given as character data -
class
Class names, given as character data
Studies of Selective Serotonin Reuptake Inhibitors (SSRIs) for major depression
Description
A dataset from a systematic review examining the efficacy of different doses of SSRI antidepressant drugs and placebo (Furukawa et al. 2019). The response to treatment is defined as a 50% reduction in depressive symptoms after 8 weeks (4-12 week range) follow-up. The dataset includes 60 RCTs comparing 5 different SSRIs with placebo.
Usage
ssri
Format
A data frame in long format (one row per arm and study), with 145 rows and 8 variables:
-
studyID
Study identifiers -
bias
Risk of bias evaluated on 6 domains -
age
Mean participant age -
weeks
Duration of study follow-up -
agent
Character data indicating the agent to which participants were randomised -
dose
Numeric data indicating the dose to which participants were randomised in mg -
n
Numeric data indicating the number of participants randomised -
r
Numeric data indicating the number of participants who achieved >50% improvement in depression symptoms
References
Furukawa TA, Cipriani A, Cowen PJ, Leucht S, Egger M, Salanti G (2019). “Optimal dose of selective serotonin reuptake inhibitors, venlafaxine, and mirtazapine in major depression: a systematic review and dose-response meta-analysis.” Lancet Psychiatry, 6, 601-609.
Print summary of MBNMA results to the console
Description
Print summary of MBNMA results to the console
Usage
## S3 method for class 'mbnma'
summary(object, digits = 4, ...)
Arguments
object |
An S3 object of class |
digits |
The maximum number of digits for numeric columns |
... |
additional arguments affecting the summary produced |
Print summary mbnma.network information to the console
Description
Print summary mbnma.network information to the console
Usage
## S3 method for class 'mbnma.network'
summary(object, ...)
Arguments
object |
An object of class |
... |
further arguments passed to or from other methods |
Produces a summary data frame from an mbnma.predict object
Description
Produces a summary data frame from an mbnma.predict object
Usage
## S3 method for class 'mbnma.predict'
summary(object, ...)
Arguments
object |
An object of |
... |
additional arguments affecting the summary produced. |
Value
A data frame containing posterior summary statistics from predicted responses from a dose-response MBNMA model
Generates summary data frames for an mbnma.rank object
Description
Generates summary data frames for an mbnma.rank object
Usage
## S3 method for class 'mbnma.rank'
summary(object, ...)
Arguments
object |
An object of |
... |
additional arguments affecting the summary produced |
Value
A list in which each element represents a parameter that has been ranked
in mbnma.rank
and contains a data frame of summary ranking results.
Generates a summary data frame for nma.nodesplit objects
Description
Generates a summary data frame for nma.nodesplit objects
Usage
## S3 method for class 'nma.nodesplit'
summary(object, ...)
Arguments
object |
An object of |
... |
further arguments passed to or from other methods |
Generates a summary data frame for nodesplit objects
Description
Generates a summary data frame for nodesplit objects
Usage
## S3 method for class 'nodesplit'
summary(object, ...)
Arguments
object |
An object of |
... |
further arguments passed to or from other methods |
Studies of triptans for headache pain relief
Description
A dataset from a systematic review of interventions for pain relief in migraine (Thorlund et al. 2014). The outcome is binary, and represents (as aggregate data) the proportion of participants who were headache-free at 2 hours. Data are from patients who had had at least one migraine attack, who were not lost to follow-up, and who did not violate the trial protocol. The dataset includes 70 Randomised-Controlled Trials (RCTs), comparing 7 triptans with placebo. Doses are standardised as relative to a "common" dose, and in total there are 23 different treatments (combination of dose and agent).
Usage
triptans
Format
A data frame in long format (one row per arm and study), with with 181 rows and 6 variables:
-
studyID
Study identifiers -
AuthorYear
The author and year published of the study -
n
Numeric data indicating the number of participants in a study arm -
r
Numeric data indicating the number of responders (headache free at 2 hours) in a study arm -
dose
Numeric data indicating the standardised dose received -
agent
Factor data indicating the agent to which participants were randomised
Source
There are no references for Rd macro \insertAllCites
on this help page.