Title: | Dose-Response MBNMA Models |
---|---|
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. |
Authors: | Hugo Pedder [aut, cre] , Adil Karim [ctb] |
Maintainer: | Hugo Pedder <[email protected]> |
License: | GPL-3 |
Version: | 0.4.3 |
Built: | 2024-11-20 09:28:44 UTC |
Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
Adds arm indices (arms
, narms
) to a dataset and adds numeric identifiers for
agent and class (if included in the data).
add_index(data.ab, agents = NULL, treatments = NULL)
add_index(data.ab, agents = NULL, treatments = NULL)
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 |
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).
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.
alog_pcfb
alog_pcfb
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
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
.
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
calc.edx(mbnma, x = 50)
calc.edx(mbnma, x = 50)
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 |
A data frame of posterior EDx summary values for each agent
Update model fit statistics depending on calculation for pD
changepd(model, jagsdata = NULL, pd = "pv", likelihood = NULL, type = "dose")
changepd(model, jagsdata = NULL, pd = "pv", likelihood = NULL, type = "dose")
model |
A model object of class |
jagsdata |
A list object containing data used to estimate |
pd |
Can take either:
|
likelihood |
A string indicating the likelihood to use in the model. Can take either |
type |
Can take either |
A list containing pd
(effective number of parameters calculated using the method
specified in arguments), deviance
(the posterior median of the total residual deviance)
and dic
(the model DIC)
MBNMAtime
)Check if all nodes in the network are connected (identical to function in MBNMAtime
)
check.network(g, reference = 1)
check.network(g, reference = 1)
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
cumrank(x, params = NULL, sucra = TRUE, ...)
cumrank(x, params = NULL, sucra = TRUE, ...)
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 |
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
.
# 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)
# 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)
This function creates JAGS code snippets for default MBNMA model priors.
default.priors( fun = dloglin(), UME = FALSE, regress.mat = NULL, regress.effect = "common", om = list(rel = 5, abs = 10) )
default.priors( fun = dloglin(), UME = FALSE, regress.mat = NULL, regress.effect = "common", om = list(rel = 5, abs = 10) )
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 ( |
A list, each element of which is a named JAGS snippet corresponding to a prior in the MBNMA JAGS code.
default.priors(fun=demax())
default.priors(fun=demax())
Emax dose-response function
demax(emax = "rel", ed50 = "rel", hill = NULL, p.expon = FALSE)
demax(emax = "rel", ed50 = "rel", hill = NULL, p.expon = FALSE)
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 |
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:
With Hill parameter:
An object of class("dosefun")
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()
.
There are no references for Rd macro \insertAllCites
on this help page.
# 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")
# 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")
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.
devdev(mod1, mod2, dev.type = "resdev", n.iter = 2000, n.thin = 1, ...)
devdev(mod1, mod2, dev.type = "resdev", n.iter = 2000, n.thin = 1, ...)
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 |
# 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
# 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
devplot( mbnma, plot.type = "box", facet = TRUE, dev.type = "resdev", n.iter = mbnma$BUGSoutput$n.iter/2, n.thin = mbnma$BUGSoutput$n.thin, ... )
devplot( mbnma, plot.type = "box", facet = TRUE, dev.type = "resdev", n.iter = mbnma$BUGSoutput$n.iter/2, n.thin = mbnma$BUGSoutput$n.thin, ... )
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 |
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.
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.
# 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")
# 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")
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)
dexp(emax = "rel", onset = NULL, p.expon = FALSE)
dexp(emax = "rel", onset = NULL, p.expon = FALSE)
emax |
Pooling for Emax parameter. Can take |
onset |
Pooling for onset parameter. Can take |
p.expon |
A logical object to indicate whether |
1-parameter model:
2-parameter model:
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. |
An object of class("dosefun")
There are no references for Rd macro \insertAllCites
on this help page.
# Single parameter exponential function is default dexp() # Two parameter exponential function dexp(onset="rel")
# Single parameter exponential function is default dexp() # Two parameter exponential function dexp(onset="rel")
Fractional polynomial dose-response function
dfpoly(degree = 1, beta.1 = "rel", beta.2 = "rel", power.1 = 0, power.2 = 0)
dfpoly(degree = 1, beta.1 = "rel", beta.2 = "rel", power.1 = 0, power.2 = 0)
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 ( |
represents the 1st coefficient.
represents the 2nd coefficient.
represents the 1st fractional polynomial power
represents the 2nd fractional polynomial power
For a polynomial of degree=1
:
For a polynomial of degree=2
:
is a regular power except where
, where
.
If a fractional polynomial power
repeats within the function it is multiplied by another
.
An object of class("dosefun")
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()
.
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.
# 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)
# 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)
Similar parameterisation to the Emax model but with non-asymptotic maximal effect (Emax). Proposed by proposed by Fu and Manner (2010)
ditp(emax = "rel", rate = "rel", p.expon = FALSE)
ditp(emax = "rel", rate = "rel", p.expon = FALSE)
emax |
Pooling for Emax parameter. Can take |
rate |
Pooling for Rate parameter. Can take |
p.expon |
A logical object to indicate whether |
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
An object of class("dosefun")
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()
.
Fu H, Manner D (2010). “Bayesian adaptive dose-finding studies with delayed responses.” J Biopharm Stat, 20(5), 1055-1070. doi:10.1080/10543400903315740.
# Model a common effect on rate ditp(emax="rel", rate="common")
# Model a common effect on rate ditp(emax="rel", rate="common")
Modelled assuming relative effects ("rel"
)
dloglin()
dloglin()
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. |
An object of class("dosefun")
There are no references for Rd macro \insertAllCites
on this help page.
dloglin()
dloglin()
Function combines different dose-response functions together to create an object containing parameters for multiple dose-response functions.
dmulti(funs = list())
dmulti(funs = list())
funs |
A list of objects of |
An object of class("dosefun")
funs <- c(rep(list(demax()),3), rep(list(dloglin()),2), rep(list(demax(ed50="common")),3), rep(list(dexp()),2)) dmulti(funs)
funs <- c(rep(list(demax()),3), rep(list(dloglin()),2), rep(list(demax(ed50="common")),3), rep(list(dexp()),2)) dmulti(funs)
Used to fit monotonically increasing non-parametric dose-response relationship following the method of Owen et al. (2015))
dnonparam(direction = "increasing")
dnonparam(direction = "increasing")
direction |
Can take either |
An object of class("dosefun")
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/.
# Monotonically increasing dose-response dnonparam(direction="increasing") # Monotonically decreasing dose-response dnonparam(direction="decreasing")
# Monotonically increasing dose-response dnonparam(direction="increasing") # Monotonically decreasing dose-response dnonparam(direction="decreasing")
Polynomial dose-response function
dpoly( degree = 1, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel" )
dpoly( degree = 1, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel" )
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 |
represents the 1st coefficient.
represents the 2nd coefficient.
represents the 3rd coefficient.
represents the 4th coefficient.
Linear model:
Quadratic model:
Cubic model:
Quartic model:
An object of class("dosefun")
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()
.
There are no references for Rd macro \insertAllCites
on this help page.
# 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")
# 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")
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.
DR.comparisons(data.ab, level = "treatment", doselink = NULL)
DR.comparisons(data.ab, level = "treatment", doselink = NULL)
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 |
Drops arms in a way which preserves connectivity and equally removes data from each treatment in a nodesplit comparison (so as to maximise precision)
drop.comp(ind.df, drops, comp, start = 1)
drop.comp(ind.df, drops, comp, start = 1)
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
drop.disconnected(network, connect.dose = FALSE)
drop.disconnected(network, connect.dose = FALSE)
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 ( |
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
# 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))
# 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))
Used to fit B-splines, natural cubic splines, and piecewise linear splines(Perperoglu et al. 2019).
dspline( type = "bs", knots = 1, degree = 1, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel" )
dspline( type = "bs", knots = 1, degree = 1, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel" )
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 |
An object of class("dosefun")
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()
.
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.
# 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")
# 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
duser(fun, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel")
duser(fun, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel")
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 |
An object of class("dosefun")
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()
.
There are no references for Rd macro \insertAllCites
on this help page.
dr <- ~ beta.1 * (1/(dose+1)) + beta.2 * dose^2 duser(fun=dr, beta.1="common", beta.2="rel")
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
fitplot( mbnma, disp.obs = TRUE, n.iter = mbnma$BUGSoutput$n.iter, n.thin = mbnma$BUGSoutput$n.thin, ... )
fitplot( mbnma, disp.obs = TRUE, n.iter = mbnma$BUGSoutput$n.iter, n.thin = mbnma$BUGSoutput$n.thin, ... )
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 |
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.
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.
# 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)
# 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
gen.parameters.to.save(fun, model, regress.mat = NULL)
gen.parameters.to.save(fun, model, regress.mat = NULL)
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
genspline( x, spline = "bs", knots = 1, degree = 1, max.dose = max(x), boundaries = NULL )
genspline( x, spline = "bs", knots = 1, degree = 1, max.dose = max(x), boundaries = NULL )
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 |
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.
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)
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)
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.
get.prior(model)
get.prior(model)
model |
A character object of JAGS MBNMA model code |
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.
A character vector, each element of which is a line of JAGS code corresponding to a prior in the JAGS code.
# 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)
# 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
get.relative( lower.diag, upper.diag = lower.diag, treatments = list(), lower.direction = "colvrow", upper.direction = "rowvcol", regress.vals = NULL, eform = FALSE, lim = "cred" )
get.relative( lower.diag, upper.diag = lower.diag, treatments = list(), lower.direction = "colvrow", upper.direction = "rowvcol", regress.vals = NULL, eform = FALSE, lim = "cred" )
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 ( |
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.
# 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")
# 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")
Converts MBNMA data frame to a list for use in JAGS model
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 )
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 )
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 |
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 (if level="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 (if level="agent"
)
agent
A matrix of agent codes within each study (if level="agent"
)
NT
The total number of treatment in the dataset (if level="treatment"
)
treatment
A matrix of treatment codes within each study (if level="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.
# 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")
# 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")
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).
gout
gout
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
Pfizer Ltd.
Identify comparisons informed by both direct and indirect evidence from independent sources, which therefore fulfill the criteria for testing for inconsistency via node-splitting.
inconsistency.loops(df, checkindirect = TRUE, incldr = FALSE)
inconsistency.loops(df, checkindirect = TRUE, incldr = FALSE)
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. |
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
.
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/
There are no references for Rd macro \insertAllCites
on this help page.
# 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 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 contrasts within a network that make up all the head-to-head comparisons. Repetitions of the same treatment comparison are grouped together.
mbnma.comparisons(df)
mbnma.comparisons(df)
df |
A data frame containing variables |
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.
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)
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)
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.
mbnma.nodesplit( network, fun = dpoly(degree = 1), method = "common", comparisons = NULL, incldr = TRUE, ... ) ## S3 method for class 'nodesplit' plot(x, plot.type = "forest", ...)
mbnma.nodesplit( network, fun = dpoly(degree = 1), method = "common", comparisons = NULL, incldr = TRUE, ... ) ## S3 method for class 'nodesplit' plot(x, plot.type = "forest", ...)
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 |
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.
Plots the desired graph if plot.type="forest"
and plots and returns an object
of class(c("gg", "ggplot"))
if plot.type="density"
.
plot(nodesplit)
: Plot outputs from treatment-level nodesplit MBNMA models
# 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
# 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
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).
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 = "pd.kl", 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, ... )
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 = "pd.kl", 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, ... )
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 |
Can take either:
|
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. |
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.
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.
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. |
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.
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.
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.
# 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) # Calculate effective number of parameters via plugin method result <- mbnma.run(network, fun=dloglin(), method="random", pd="plugin") # Calculate effective number of parameters using penalized expected deviance result <- mbnma.run(network, fun=dloglin(), method="random", pd="popt") ####### 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)
# 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) # Calculate effective number of parameters via plugin method result <- mbnma.run(network, fun=dloglin(), method="random", pd="plugin") # Calculate effective number of parameters using penalized expected deviance result <- mbnma.run(network, fun=dloglin(), method="random", pd="popt") ####### 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)
Useful for obtaining deviance contributions or fitted values. Same function used in MBNMAdose and MBNMAtime packages.
mbnma.update( mbnma, param = "theta", armdat = TRUE, n.iter = mbnma$BUGSoutput$n.iter, n.thin = mbnma$BUGSoutput$n.thin )
mbnma.update( mbnma, param = "theta", armdat = TRUE, n.iter = mbnma$BUGSoutput$n.iter, n.thin = mbnma$BUGSoutput$n.thin )
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
|
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
# 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
# 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
mbnma.validate.data(data.ab, single.arm = FALSE)
mbnma.validate.data(data.ab, single.arm = FALSE)
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 ( |
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
An error if checks are not passed. Runs silently if checks are passed
Writes JAGS code for a Bayesian time-course model for model-based network meta-analysis (MBNMA).
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 )
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 )
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. |
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.
A single long character string containing the JAGS model generated based on the arguments passed to the function.
# 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)
# 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)
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.
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, ...)
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, ...)
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 |
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.
Plots the desired graph(s) and returns an object (or list of object if
plot.type=NULL
) of class(c("gg", "ggplot"))
plot(nma.nodesplit)
: Plot outputs from treatment-level nodesplit models
# 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
# 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
Converts mean and variance of normal distribution to the parameters for a log-normal distribution with the same mean and variance
norm2lnorm(m, v)
norm2lnorm(m, v)
m |
Mean of the normal distribution |
v |
Variance of the normal distribution |
A vector of length two. The first element is the mean and the second element is the variance of the log-normal distribution
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)
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)
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.
osteopain
osteopain
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
Pfizer Ltd.
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.
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.
pDcalc( obs1, obs2, fups = NULL, narm, NS, theta.result, resdev.result, likelihood = "normal", type = "time" )
pDcalc( obs1, obs2, fups = NULL, narm, NS, theta.result, resdev.result, likelihood = "normal", type = "time" )
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 |
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).
A single numeric value for pD calculated via the plugin method.
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.
# 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")
# 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")
Generates a forest plot for dose-response parameters.
## S3 method for class 'mbnma' plot(x, params = NULL, ...)
## S3 method for class 'mbnma' plot(x, params = NULL, ...)
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 |
A forest plot of class c("gg", "ggplot")
that has separate panels for
different dose-response parameters. Results are plotted on the link scale.
# 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"))
# 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"))
Creates an object of class("mbnma.network")
. Various MBNMA functions can subsequently be applied
to this object.
## 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")
## 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")
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. |
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.
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.
plot(mbnma.network)
: Generate a network plot
# 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)
# 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 on the natural scale from a dose-response MBNMA model.
## S3 method for class 'mbnma.predict' plot( x, disp.obs = FALSE, overlay.split = FALSE, method = "common", agent.labs = NULL, scales = "free_x", ... )
## S3 method for class 'mbnma.predict' plot( x, disp.obs = FALSE, overlay.split = FALSE, method = "common", agent.labs = NULL, scales = "free_x", ... )
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 |
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.
# 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)
# 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
## S3 method for class 'mbnma.rank' plot(x, params = NULL, treat.labs = NULL, ...)
## S3 method for class 'mbnma.rank' plot(x, params = NULL, treat.labs = NULL, ...)
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 |
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"))
.
# 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")
# 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")
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.
## 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 = "pd.kl", parameters.to.save = NULL, ... )
## 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 = "pd.kl", parameters.to.save = NULL, ... )
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 |
Can take either:
|
parameters.to.save |
A character vector containing names of parameters to monitor in JAGS |
plot(nma)
: Plot outputs from treatment-level NMA models
Results 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
).
# 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)
# 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)
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).
## S3 method for class 'mbnma' predict( object, n.doses = 30, exact.doses = NULL, E0 = 0.2, synth = "fixed", lim = "cred", regress.vals = NULL, ... )
## S3 method for class 'mbnma' predict( object, n.doses = 30, exact.doses = NULL, E0 = 0.2, synth = "fixed", lim = "cred", regress.vals = NULL, ... )
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 |
The range of doses on which to make predictions can be specified in one of two ways:
Use max.dose
and n.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 (provided n.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]
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 in times
for each treatment specified in
treats
likelihood
The likelihood used in the MBNMA model object
link
The link function used in the MBNMA model object
network
The dataset in mbnma.network
format
E0
A numeric vector of value(s) used for E0 in the prediction, on the
link scale.
# 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)
# 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
## S3 method for class 'mbnma.network' print(x, ...)
## S3 method for class 'mbnma.network' print(x, ...)
x |
An object of class |
... |
further arguments passed to or from other methods |
Print summary information from an mbnma.predict object
## S3 method for class 'mbnma.predict' print(x, ...)
## S3 method for class 'mbnma.predict' print(x, ...)
x |
An object of |
... |
further arguments passed to or from other methods |
Prints summary information about an mbnma.rank object
## S3 method for class 'mbnma.rank' print(x, ...)
## S3 method for class 'mbnma.rank' print(x, ...)
x |
An object of class |
... |
further arguments passed to or from other methods |
Prints summary results from an nma.nodesplit object
## S3 method for class 'nma.nodesplit' print(x, ...)
## S3 method for class 'nma.nodesplit' print(x, ...)
x |
An object of |
... |
further arguments passed to or from other methods |
Prints summary results from a nodesplit object
## S3 method for class 'nodesplit' print(x, ...)
## S3 method for class 'nodesplit' print(x, ...)
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
## S3 method for class 'relative.array' print(x, digits = 2, ...)
## S3 method for class 'relative.array' print(x, digits = 2, ...)
x |
An object of class |
digits |
An integer indicating the number of significant digits to be used. |
... |
further arguments passed to |
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.
psoriasis100
psoriasis100
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
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.
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.
psoriasis75
psoriasis75
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
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.
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.
psoriasis90
psoriasis90
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
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
rank(x, ...)
rank(x, ...)
x |
An object on which to apply the rank method |
... |
Arguments to be passed to methods |
Only parameters that vary by agent/class can be ranked.
## S3 method for class 'mbnma' rank( x, params = NULL, lower_better = TRUE, level = "agent", to.rank = NULL, ... )
## S3 method for class 'mbnma' rank( x, params = NULL, lower_better = TRUE, level = "agent", to.rank = NULL, ... )
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 |
Ranking cannot currently be performed on non-parametric dose-response MBNMA
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.
# 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)
# 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)
Ranks predictions at different doses from best to worst.
## S3 method for class 'mbnma.predict' rank(x, lower_better = TRUE, rank.doses = NULL, ...)
## S3 method for class 'mbnma.predict' rank(x, lower_better = TRUE, rank.doses = NULL, ...)
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 |
If predict
contains multiple predictions at dose=0, then only the first of these
will be included, to avoid duplicating rankings.
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.
# 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)
# 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)
Ranks "relative.table"
objects generated by get.relative()
.
## S3 method for class 'relative.array' rank(x, lower_better = TRUE, ...)
## S3 method for class 'relative.array' rank(x, lower_better = TRUE, ...)
x |
An object on which to apply the rank method |
lower_better |
Indicates whether negative responses are better ( |
... |
Arguments to be passed to methods |
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.
# 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)
# 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
recode.agent(data.ab, level = "agent")
recode.agent(data.ab, level = "agent")
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
level |
Can take either |
Also relabels the agent for any arms in which dose = 0 to "Placebo_0"
A list containing a data frame with recoded agent/class identifiers and a character vector of original agent/class names
Synthesises single arm studies to estimate E0. Used in predicting responses from a dose-response MBNMA.
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, ... )
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, ... )
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 |
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
.
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.
# 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)
# 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
rescale.link(x, direction = "link", link = "logit")
rescale.link(x, direction = "link", link = "logit")
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. |
A rescaled numeric vector
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.
ssi_closure
ssi_closure
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
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.
ssri
ssri
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
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
## S3 method for class 'mbnma' summary(object, digits = 4, ...)
## S3 method for class 'mbnma' summary(object, digits = 4, ...)
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
## S3 method for class 'mbnma.network' summary(object, ...)
## S3 method for class 'mbnma.network' summary(object, ...)
object |
An object of class |
... |
further arguments passed to or from other methods |
Produces a summary data frame from an mbnma.predict object
## S3 method for class 'mbnma.predict' summary(object, ...)
## S3 method for class 'mbnma.predict' summary(object, ...)
object |
An object of |
... |
additional arguments affecting the summary produced. |
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
## S3 method for class 'mbnma.rank' summary(object, ...)
## S3 method for class 'mbnma.rank' summary(object, ...)
object |
An object of |
... |
additional arguments affecting the summary produced |
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
## S3 method for class 'nma.nodesplit' summary(object, ...)
## S3 method for class 'nma.nodesplit' summary(object, ...)
object |
An object of |
... |
further arguments passed to or from other methods |
Generates a summary data frame for nodesplit objects
## S3 method for class 'nodesplit' summary(object, ...)
## S3 method for class 'nodesplit' summary(object, ...)
object |
An object of |
... |
further arguments passed to or from other methods |
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).
triptans
triptans
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
There are no references for Rd macro \insertAllCites
on this help page.