Movatterモバイル変換


[0]ホーム

URL:


Type:Package
Title:Dose-Response MBNMA Models
Version:0.5.0
Language:en-GB
Date:2025-02-06
URL:https://hugaped.github.io/MBNMAdose/
Maintainer:Hugo Pedder <hugopedder@gmail.com>
Description:Fits Bayesian dose-response model-based network meta-analysis (MBNMA) that incorporate multiple doses within an agent by modelling different dose-response functions, as described by Mawdsley et al. (2016) <doi:10.1002/psp4.12091>. By modelling dose-response relationships this can connect networks of evidence that might otherwise be disconnected, and can improve precision on treatment estimates. Several common dose-response functions are provided; others may be added by the user. Various characteristics and assumptions can be flexibly added to the models, such as shared class effects. The consistency of direct and indirect evidence in the network can be assessed using unrelated mean effects models and/or by node-splitting at the treatment level.
License:GPL-3
Depends:R (≥ 3.0.2)
Imports:grDevices, stats, graphics, utils, scales, dplyr (≥ 0.7.4),R2jags (≥ 0.5-7), rjags (≥ 4-8), magrittr (≥ 1.5), checkmate(≥ 1.8.5), Rdpack (≥ 0.11-0), igraph (≥ 2.0.1.1), ggplot2(≥ 2.2.1), reshape2 (≥ 1.4.3)
Suggests:overlapping (≥ 1.5.0), RColorBrewer (≥ 1.1-2), mcmcplots(≥ 0.4.3), coda (≥ 0.19-4), testthat (≥ 1.0.2), crayon (≥1.3.4), forestplot (≥ 1.10), ggdist (≥ 2.4.0), zoo (≥1.8-8), lspline (≥ 1.0-0), formatR (≥ 1.14), netmeta, knitr,rmarkdown
SystemRequirements:JAGS (>= 4.3.0)(https://mcmc-jags.sourceforge.net/)
Encoding:UTF-8
LazyData:true
VignetteBuilder:knitr
RoxygenNote:7.2.3
RdMacros:Rdpack
NeedsCompilation:no
Packaged:2025-02-06 19:58:33 UTC; hp17602
Author:Hugo PedderORCID iD [aut, cre], Adil Karim [ctb]
Repository:CRAN
Date/Publication:2025-02-07 00:40:23 UTC

MBNMAdose for dose-response Model-Based Network Meta-Analysis

Description

MBNMAdose provides a collection of useful commands that allow users to run dose-responseModel-Based Network Meta-Analyses (MBNMA).

Introduction

MBNMAdose allows meta-analysis of studies that compare multiple doses of different agents in a way that canaccount for the dose-response relationship.

Whilst making use of all the available evidence in a statistically robust and biologically plausible framework,this also can help connect networks at the agent level that may otherwise be disconnected at the dose/treatmentlevel, and help improve precision of estimates (Pedder et al. 2021). The modelling framework is based on synthesising relative effectswhich avoids the necessity to adjust for baseline predictors, thereby making fewer assumptions than in typicalModel-Based Meta-Analysis.

By modelling the dose-response, MBNMA avoids heterogeneity and inconsistency that can arise from "lumping" differentdoses together (a technique sometimes done in Network Meta-Analysis). All models and analyses are implementedin a Bayesian framework, following an extension of the standard NMA methodology presented byLu and Ades (2004) and are run in (). For full details ofdose-response MBNMA methodology see Mawdsley et al. (2016). Within this package werefer to atreatment as a specificdose or a specificagent.

Workflow

Functions withinMBNMAdose follow a clear pattern of use:

  1. Load your data into the correct format usingmbnma.network()

  2. Analyse your data usingmbnma.run() with a wide range of dose-response functions

  3. Examine model results using forest plots and treatment rankings

  4. Check model fit and test for consistency using functions likembnma.nodesplit()

  5. Use your model to predict responses usingpredict()

At each of these stages there are a number of informative plots that can be generated to help understandthe data and to make decisions regarding model fitting.

Author(s)

Maintainer: Hugo Pedderhugopedder@gmail.com (ORCID)

Other contributors:

References

(2017).https://mcmc-jags.sourceforge.io/.

Lu G, Ades AE (2004).“Combination of direct and indirect evidence in mixed treatment comparisons.”Stat Med,23(20), 3105-24.ISSN 0277-6715 (Print) 0277-6715 (Linking),doi:10.1002/sim.1875,https://pubmed.ncbi.nlm.nih.gov/15449338/.

Mawdsley D, Bennetts M, Dias S, Boucher M, Welton NJ (2016).“Model-Based Network Meta-Analysis: A Framework for Evidence Synthesis of Clinical Trial Data.”CPT Pharmacometrics Syst Pharmacol,5(8), 393-401.ISSN 2163-8306 (Electronic) 2163-8306 (Linking),doi:10.1002/psp4.12091,https://pubmed.ncbi.nlm.nih.gov/27479782/.

Pedder H, Dias S, Bennetts M, Boucher M, Welton NJ (2021).“Joining the dots: Linking disconnected networks of evidence using dose-response Model-Based Network Meta-Analysis.”Medical Decision Making,41(2), 194-208.

See Also

Useful links:

Examples

# Generate an "mbnma.network" object that stores data in the correct formatnetwork <- mbnma.network(triptans)# Generate a network plot at the dose/treatment levelplot(network, level="treatment")# Generate a network plot at the agent levelplot(network, level="agent", remove.loops=TRUE)# Perform "split" NMA to examine dose-response relationshipnma <- nma.run(network)plot(nma)# Analyse data using mbnma.run() with an Emax dose-response function# and common treatment effectsresult <- mbnma.run(network, fun=demax(),  method="common")# Generate forest plots for model resultsplot(result)# Rank results and plot rankogramsranks <- rank(result)plot(ranks, params="emax")# Predict responsespred <- predict(result, E0=0.2)# Plot predicted response with "split" NMA results displayedplot(pred, overlay.split=TRUE)

Pipe operator

Description

Seemagrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of callingrhs(lhs).


Adds placebo comparisons for dose-response relationship

Description

Function adds additional rows to a data.frame of comparisons in a network that accountfor the relationship between placebo and other agents via the dose-responserelationship.

Usage

DR.comparisons(data.ab, level = "treatment", doselink = NULL)

Arguments

data.ab

A data frame stored in anmbnma.network object (mbnma.network$data.ab)

level

A character that can take either"treatment" or"agent" to indicate the level of thenetwork for which to identify dose-response

doselink

If given an integer value it indicates that connections via the dose-responserelationship with placebo should be plotted. The integer represents the minimum number of dosesfrom which a dose-response function could be estimated and is equivalent to the number ofparameters in the desired dose-response function plus one. If left asNULL (the default), connectionsto placebo via dose-response relationships will not be included.


Add arm indices and agent identifiers to a dataset

Description

Adds arm indices (arms,narms) to a dataset and adds numeric identifiers foragent and class (if included in the data).

Usage

add_index(data.ab, agents = NULL, treatments = NULL)

Arguments

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifiermust also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardisetreatment effects when modelling using Standardised Mean Differences (SMD).

agents

A character string of agent names used to force a particular agent ordering.Default isNULL, which automatically ordersPlacebo (dose=0) as agent1 and thensubsequent agents by the order given indata.ab

treatments

A character string of treatment names used to force a particular treatment ordering.Default isNULL, which automatically ordersPlacebo (dose=0) as treatment1 and thensubsequent treatments by the order of agents and doses (smallest to highest) given indata.ab

Value

A data frame similar todata.ab but with additional columns:

Ifagent orclass 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 sequentialnumbering (a warning will be shown stating this).


Studies of alogliptin for lowering blood glucose concentration in patients with type II diabetes

Description

A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing different doses ofalogliptin with placebo (Langford et al. 2016). The systematic review was simply performed and was intended toprovide data to illustrate a statistical methodology rather than for clinical inference. Alogliptin isa 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 studiesof at least 12 weeks follow-up. The dataset includes 14 Randomised-Controlled Trials (RCTs), comparing 5different doses of alogliptin with placebo, leading to 6 different treatments (combination of dose and agent)within the network.

Usage

alog_pcfb

Format

A data frame in long format (one row per arm and study), with 46 rows and 6 variables:

Details

alog_pcfb is a data frame in long format (one row per arm and study), with the variablesstudyID,agent,dose,y,se, andN.

References

Langford O, Aronson JK, van Valkenhoef G, Stevens RJ (2016).“Methods for meta-analysis of pharmacodynamic dose-response data with application to multi-arm studies of alogliptin.”Stat Methods Med Res.ISSN 1477-0334 (Electronic) 0962-2802 (Linking),doi:10.1177/0962280216637093.


Calculates values for EDx from an Emax model, the dose at which x% of the maximal response (Emax)is reached

Description

Calculates values for EDx from an Emax model, the dose at which x% of the maximal response (Emax)is reached

Usage

calc.edx(mbnma, x = 50)

Arguments

mbnma

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

x

A numeric value between 0 and 100 for the dose at which x% of the maximal response (Emax)should be calculated

Value

A data frame of posterior EDx summary values for each agent


Check if all nodes in the network are connected (identical to function inMBNMAtime)

Description

Check if all nodes in the network are connected (identical to function inMBNMAtime)

Usage

check.network(g, reference = 1)

Arguments

g

An network plot ofclass("igraph")

reference

A numeric value indicating which treatment code to use as the reference treatment fortesting that all other treatments connect to it


Plot cumulative ranking curves from MBNMA models

Description

Plot cumulative ranking curves from MBNMA models

Usage

cumrank(x, params = NULL, sucra = TRUE, ...)

Arguments

x

An object of class"mbnma.rank" generated byrank.mbnma()

params

A character vector of named parameters in the model that vary by either agentor class (depending on the value assigned tolevel). If left asNULL (the default), thenranking will be calculated for all available parameters that vary by agent/class.

sucra

A logical object to indicate whether Surface Under Cumulative Ranking Curve (SUCRA)values should be calculated and returned as a data frame. Areas calculatedusing trapezoid approach.

...

Arguments to be sent toggplot::geom_line()

Value

Line plots showing the cumulative ranking probabilities for each agent/class anddose-response parameter inx. The object returned is a list which contains the plot(an object of⁠class(c("gg", "ggplot")⁠) and a data frame of SUCRA valuesifsucra = TRUE.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Estimate rankings  from an Emax dose-response MBNMAemax <- 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 returnedcumrank(ranks)

Sets default priors for JAGS model code

Description

This function creates JAGS code snippets for default MBNMA model priors.

Usage

default.priors(  fun = dloglin(),  UME = FALSE,  regress.mat = NULL,  regress.effect = "common",  om = list(rel = 5, abs = 10))

Arguments

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

UME

A boolean object to indicate whether to fit an Unrelated Mean Effects modelthat does not assume consistency and so can be used to test if the consistencyassumption 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"common" (assumed to be equal versus Placebo throughout the network),"random" (assumed to be exchangeable versus Placebo throughout the network),"agent" (assumed to be equal versus Placebo within each agent), or"class" (assumed to be equal versus Placebo within each class).

om

a list with two elements that report the maximum relative ("rel") and maximum absolute ("abs") efficacieson the link scale.

Value

A list, each element of which is a named JAGS snippetcorresponding to a prior in the MBNMA JAGS code.

Examples

default.priors(fun=demax())

Emax dose-response function

Description

Emax dose-response function

Usage

demax(emax = "rel", ed50 = "rel", hill = NULL, p.expon = FALSE)

Arguments

emax

Pooling for Emax parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

ed50

Pooling for ED50 parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

hill

Pooling for Hill parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

p.expon

A logical object to indicate whethered50 andhill parameters should beexpressed within the dose-response function on an exponential scale

Details

Emax represents the maximum response.exp(ED50) represents the dose at which 50% of the maximum response is achieved.exp(Hill) is the Hill parameter, which allows for a sigmoidal function.

Without Hill parameter:

\frac{E_{max}\times{x}}{ET_{50}+x}

With Hill parameter:

\frac{E_{max}\times{x^{hill}}}{ET_{50}\times{hill}}+x^{hill}

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

# Model without a Hill parameterdemax(emax="rel", ed50="common")# Model including a Hill parameter and defaults for Emax and ED50 parametersdemax(hill="common")

Dev-dev plot for comparing deviance contributions from two models

Description

Plots the deviances of two model types for comparison. Often used to assessconsistency by comparing consistency (NMA or MBNMA) and unrelated mean effects (UME)models (see Pedder et al. (2021)). Models must be runon thesame set of data or the deviance comparisons will not be valid.

Usage

devdev(mod1, mod2, dev.type = "resdev", n.iter = 2000, n.thin = 1, ...)

Arguments

mod1

First model for which to plot deviance contributions

mod2

Second model for which to plot deviance contributions

dev.type

STILL IN DEVELOPMENT FOR MBNMAdose! Deviances to plot - can be either residualdeviances ("resdev", the default) or deviances ("dev")

n.iter

number of total iterations per chain (including burn in;default: 2000)

n.thin

thinning rate. Must be a positive integer. Setn.thin > 1 to save memory and computation time ifn.iter is large. Default ismax(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are atleast 2000 simulations.

...

Arguments to be sent toggplot2::geom_point() orggplot2::geom_boxplot

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an poorly fitting linear dose-responselin <- mbnma.run(network, fun=dpoly(degree=1))# Run a better fitting Emax dose-responseemax <- 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 Emaxdevdev(lin, emax) # Suggests model fit is very different# Compare deviance contributions from Emax and UMEdevdev(emax, ume) # Suggests model fit is similar

Plot deviance contributions from an MBNMA model

Description

Plot deviance contributions from an MBNMA model

Usage

devplot(  mbnma,  plot.type = "box",  facet = TRUE,  dev.type = "resdev",  n.iter = mbnma$BUGSoutput$n.iter/2,  n.thin = mbnma$BUGSoutput$n.thin,  ...)

Arguments

mbnma

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

plot.type

Deviances can be plotted either as scatter points ("scatter")or as boxplots ("box")

facet

A boolean object that indicates whether or not to facet (by agent forMBNMAdoseand by treatment forMBNMAtime)

dev.type

STILL IN DEVELOPMENT FOR MBNMAdose! Deviances to plot - can be either residualdeviances ("resdev", the default) or deviances ("dev")

n.iter

number of total iterations per chain (including burn in;default: 2000)

n.thin

thinning rate. Must be a positive integer. Setn.thin > 1 to save memory and computation time ifn.iter is large. Default ismax(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are atleast 2000 simulations.

...

Arguments to be sent toggplot2::geom_point() orggplot2::geom_boxplot

Details

Deviances should only be plotted for models that have converged successfully. If deviancecontributions have not been monitored inmbnma$parameters.to.save then additionaliterations will have to be run to get results for these.

ForMBNMAtime, 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 thesemodels is treated as unknown (ifrho = "estimate") and deviance contributions will be correlated.

Value

Generates a plot of deviance contributions and returns a list containing theplot (as an object ofclass(c("gg", "ggplot"))), and a data.frame of posterior meandeviance/residual deviance contributions for each observation.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMA and predict responsesemax <- mbnma.run(network, fun=demax(), method="random")# Plot deviancesdevplot(emax)# Plot deviances using boxplotsdevplot(emax, plot.type="box")# Plot deviances on a single scatter plot (not facetted by agent)devplot(emax, facet=FALSE, plot.type="scatter")# A data frame of deviance contributions can be obtained from the object#returned by `devplot`devs <- devplot(emax)head(devs$dev.data)# Other deviance contributions not currently implemented but in future#it will be possible to plot them like so#devplot(emax, dev.type="dev")

Exponential dose-response function

Description

Similar parameterisation to the Emax model but with non-asymptotic maximal effect (Emax). Can fita 1-parameter (Emax only) or 2-parameter model (includes onset parameter that controls the curvature ofthe dose-response relationship)

Usage

dexp(emax = "rel", onset = NULL, p.expon = FALSE)

Arguments

emax

Pooling for Emax parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

onset

Pooling for onset parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

p.expon

A logical object to indicate whethered50 andhill parameters should beexpressed within the dose-response function on an exponential scale

Details

1-parameter model:emax\times{(1-exp(-x))}

2-parameter model:emax\times{(1-exp(onset*-x))}

where emax is the maximum efficacy of an agent and rate is the speed

Dose-response parameter arguments:

ArgumentModel specification
"rel" Implies thatrelative effects should be pooled for this dose-response parameter separately for each agent in the network.
"common" Implies that all agents share the same common effect for this dose-response parameter.
"random" Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents.
numeric() Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value.

Value

An object ofclass("dosefun")

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

# Single parameter exponential function is defaultdexp()# Two parameter exponential functiondexp(onset="rel")

Fractional polynomial dose-response function

Description

Fractional polynomial dose-response function

Usage

dfpoly(degree = 1, beta.1 = "rel", beta.2 = "rel", power.1 = 0, power.2 = 0)

Arguments

degree

The degree of the fractional polynomial as defined in Royston and Altman (1994)

beta.1

Pooling for the 1st fractional polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.2

Pooling for the 2nd fractional polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

power.1

Value for the 1st fractional polynomial power (\gamma_1). Must take any numeric value in the set⁠-2, -1, -0.5, 0, 0.5, 1, 2, 3⁠.

power.2

Value for the 2nd fractional polynomial power (\gamma_2). Must take any numeric value in the set⁠-2, -1, -0.5, 0, 0.5, 1, 2, 3⁠.

Details

For a polynomial ofdegree=1:

{\beta_1}x^{\gamma_1}

For a polynomial ofdegree=2:

{\beta_1}x^{\gamma_1}+{\beta_2}x^{\gamma_2}

x^{\gamma} is a regular power except where\gamma=0, wherex^{(0)}=ln(x).If a fractional polynomial power\gamma repeats within the function it is multiplied by anotherln(x).

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

Royston P, Altman D (1994).“Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling.”Journal of the Royal Statistical Society: Series C,43(3), 429-467.

Examples

# 1st order fractional polynomial a value of 0.5 for the powerdfpoly(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 respectivelydfpoly(degree=2, beta.1="rel", beta.2="rel",  power.1=-0.5, power.2=2)

Integrated Two-Component Prediction (ITP) function

Description

Similar parameterisation to the Emax model but with non-asymptotic maximal effect (Emax). Proposedby proposed by Fu and Manner (2010)

Usage

ditp(emax = "rel", rate = "rel", p.expon = FALSE)

Arguments

emax

Pooling for Emax parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

rate

Pooling for Rate parameter. Can take"rel","common","random" or beassigned a numeric value (see details).

p.expon

A logical object to indicate whethered50 andhill parameters should beexpressed within the dose-response function on an exponential scale

Details

Emax represents the maximum response.Rate represents the rate at which a change in the dose of the drug leads toa change in the effect

{E_{max}}\times\frac{(1-exp(-{rate}\times{x}))}{(1-exp(-{rate}\times{max(x)}))}

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

Fu H, Manner D (2010).“Bayesian adaptive dose-finding studies with delayed responses.”J Biopharm Stat,20(5), 1055-1070.doi:10.1080/10543400903315740.

Examples

# Model a common effect on rateditp(emax="rel", rate="common")

Log-linear (exponential) dose-response function

Description

Modelled assuming relative effects ("rel")

Usage

dloglin()

Details

rate\times{log(x + 1)}

Dose-response parameter arguments:

ArgumentModel specification
"rel" Implies thatrelative effects should be pooled for this dose-response parameter separately for each agent in the network.
"common" Implies that all agents share the same common effect for this dose-response parameter.
"random" Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents.
numeric() Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value.

Value

An object ofclass("dosefun")

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

dloglin()

Agent-specific dose-response function

Description

Function combines different dose-response functions together to create an object containingparameters for multiple dose-response functions.

Usage

dmulti(funs = list())

Arguments

funs

A list of objects ofclass("dosefun"), each element of which corresponds toan agent in the dataset to be modelled. The list length must be equal to the number ofagents innetwork$agents used inmbnma.run(), and the order of the dose-responsefunctions in the list is assumed to correspond to the same order of agents innetwork$agents.

Value

An object ofclass("dosefun")

Examples

funs <- c(rep(list(demax()),3),          rep(list(dloglin()),2),          rep(list(demax(ed50="common")),3),          rep(list(dexp()),2))dmulti(funs)

Non-parameteric dose-response functions

Description

Used to fit monotonically increasing non-parametric dose-response relationship followingthe method of Owen et al. (2015))

Usage

dnonparam(direction = "increasing")

Arguments

direction

Can take either"increasing" or"decreasing" to indicate the monotonic directionof the dose-response relationship

Value

An object ofclass("dosefun")

References

Owen RK, Tincello DG, Keith RA (2015).“Network meta-analysis: development of a three-level hierarchical modeling approach incorporating dose-related constraints.”Value Health,18(1), 116-26.ISSN 1524-4733 (Electronic) 1098-3015 (Linking),doi:10.1016/j.jval.2014.10.006,https://pubmed.ncbi.nlm.nih.gov/25595242/.

Examples

# Monotonically increasing dose-responsednonparam(direction="increasing")# Monotonically decreasing dose-responsednonparam(direction="decreasing")

Polynomial dose-response function

Description

Polynomial dose-response function

Usage

dpoly(  degree = 1,  beta.1 = "rel",  beta.2 = "rel",  beta.3 = "rel",  beta.4 = "rel")

Arguments

degree

The degree of the polynomial - e.g.degree=1 for linear,degree=2 for quadratic,degree=3 for cubic.

beta.1

Pooling for the 1st polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.2

Pooling for the 2nd polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.3

Pooling for the 3rd polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.4

Pooling for the 4th polynomial coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

Details

Linear model:

\beta_1{x}

Quadratic model:

\beta_1{x} + \beta_2{x^2}

Cubic model:

\beta_1{x} + \beta_2{x^2} + \beta_3{x^3}

Quartic model:

\beta_1{x} + \beta_2{x^2} + \beta_3{x^3} + \beta_4{x^4}

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

# Linear model with random effectsdpoly(beta.1="rel")# Quadratic model dose-response function# with an exchangeable (random) absolute parameter estimated for the 2nd coefficientdpoly(beta.1="rel", beta.2="random")

Drop treatments from multi-arm (>2) studies for node-splitting

Description

Drops arms in a way which preserves connectivity and equally removesdata from each treatment in a nodesplit comparison (so as to maximise precision)

Usage

drop.comp(ind.df, drops, comp, start = 1)

Arguments

ind.df

A data frame in long format (one arm per row) from which to drop treatments

drops

A vector of study identifiers from which to drop treatments

comp

A numeric vector of length 2 that contains treatment codes corresponding to the comparisonfor node-splitting

start

Can take either0 or1 to indicate whether to drop the treatmentincomp[1] (0) orcomp[2] (1)


Drop studies that are not connected to the network reference treatment

Description

Drop studies that are not connected to the network reference treatment

Usage

drop.disconnected(network, connect.dose = FALSE)

Arguments

network

An object of classmbnma.network.

connect.dose

A boolean object to indicate whether treatments should bekept in the network if they connect via the simplest possible dose-responserelationship (TRUE) or not (FALSE). Simplest possible dose-response relationshipis any function with a single dose-response parameter (e.g. linear, exponential)

Value

A list containing a single row per arm data frame containing only studies that areconnected to the network reference treatment, and a character vector of treatment labels

Examples

# Using the triptans headache datasetnetwork <- mbnma.network(triptans)drops <- drop.disconnected(network)# No studies have been dropped since network is fully connectedlength(unique(network$data.ab$studyID))==length(unique(drops$data.ab$studyID))# Make data with no placebonoplac.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 functiondrops <- 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 functiondrops <- drop.disconnected(net.noplac, connect.dose=TRUE)length(unique(net.noplac$data.ab$studyID))==length(unique(drops$data.ab$studyID))

Spline dose-response functions

Description

Used to fit B-splines, natural cubic splines, andpiecewise linear splines(Perperoglu et al. 2019).

Usage

dspline(  type = "bs",  knots = 1,  degree = 1,  beta.1 = "rel",  beta.2 = "rel",  beta.3 = "rel",  beta.4 = "rel",  beta.5 = "rel",  beta.6 = "rel")

Arguments

type

The type of spline. Can take"bs" (B-spline),"ns" (natural cubic spline),or"ls" (piecewise linear spline)

knots

The number/location of spline internal knots. If a single number is given it indicates the number of knots (they willbe equally spaced across the range of dosesfor 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.degree=1 for linear,degree=2 for quadratic,degree=3 for cubic.

beta.1

Pooling for the 1st coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.2

Pooling for the 2nd coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.3

Pooling for the 3rd coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.4

Pooling for the 4th coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.5

Pooling for the 5th coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.6

Pooling for the 6th coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

Perperoglu A, Sauerbrei W, Abrahamowicz M, Schmid M (2019).“A review of spline function procedures in R.”BMC Medical Research Methodology,19(46), 1-16.doi:10.1186/s12874-019-0666-3.

Examples

# Second order B spline with 2 knots and random effects on the 2nd coefficientdspline(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 effectsdspline(type="ls", knots=c(0.1,0.5),  beta.1="random", beta.2="rel")

User-defined dose-response function

Description

User-defined dose-response function

Usage

duser(fun, beta.1 = "rel", beta.2 = "rel", beta.3 = "rel", beta.4 = "rel")

Arguments

fun

A formula specifying any relationship includingdose andone/several of:beta.1,beta.2,beta.3,beta.4.

beta.1

Pooling for the 1st coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.2

Pooling for the 2nd coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.3

Pooling for the 3rd coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

beta.4

Pooling for the 4th coefficient. Can take"rel","common","random" or beassigned a numeric value (see details).

Value

An object ofclass("dosefun")

Dose-response parameters

ArgumentModel specification
"rel" Implies thatrelative 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 matrixomegaand by changing the degrees of freedom of the inverse-Wishart priorusing thepriors argument inmbnma.run().

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

dr <- ~ beta.1 * (1/(dose+1)) + beta.2 * dose^2duser(fun=dr,  beta.1="common", beta.2="rel")

Plot fitted values from MBNMA model

Description

Plot fitted values from MBNMA model

Usage

fitplot(  mbnma,  disp.obs = TRUE,  n.iter = mbnma$BUGSoutput$n.iter,  n.thin = mbnma$BUGSoutput$n.thin,  ...)

Arguments

mbnma

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

disp.obs

A boolean object to indicate whether raw data responses should beplotted 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. Setn.thin > 1 to save memory and computation time ifn.iter is large. Default ismax(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are atleast 2000 simulations.

...

Arguments to be sent toggplot2::geom_point() orggplot2::geom_line()

Details

Fitted values should only be plotted for models that have converged successfully.If fitted values (theta) have not been monitored inmbnma$parameters.to.savethen additional iterations will have to be run to get results for these.

Value

Generates a plot of fitted values from the MBNMA model and returns a list containingthe plot (as an object ofclass(c("gg", "ggplot"))), and a data.frame of posterior meanfitted values for each observation.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMA and predict responsesemax <- mbnma.run(network, fun=demax(), method="random")# Plot fitted values and observed valuesfitplot(emax)# Plot fitted values onlyfitplot(emax, disp.obs=FALSE)# A data frame of fitted values can be obtained from the object#returned by `fitplot`fits <- fitplot(emax)head(fits$fv)

Automatically generate parameters to save for a dose-response MBNMA model

Description

Automatically generate parameters to save for a dose-response MBNMA model

Usage

gen.parameters.to.save(fun, model, regress.mat = NULL)

Arguments

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

model

A JAGS model written as a character object

regress.mat

A Nstudy x Ncovariate design matrix of meta-regression covariates


Generates spline basis matrices for fitting to dose-response function

Description

Generates spline basis matrices for fitting to dose-response function

Usage

genspline(  x,  spline = "bs",  knots = 1,  degree = 1,  max.dose = max(x),  boundaries = NULL)

Arguments

x

A numeric vector indicating all time points available in the dataset

spline

Indicates the type of spline function. Can be either a piecewise linear spline ("ls"),natural cubic spline ("ns"), or B-spline ("bs").

knots

The number/location of internal knots. If a single integer is given it indicates the number of knots (they willbe equally spaced across the range of dosesfor each agent). If a numeric vector is given it indicates the quantiles of the knots asa proportion of the maximum dose in the dataset. For example, if the maximum dose in the datasetis 100mg/d,knots=c(0.1,0.5) would indicate knots should be fitted at 10mg/d and 50mg/d.

degree

a positive integer giving the degree of the polynomial from which the spline function is composed(e.g.degree=3 represents a cubic spline).

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 naturalcubic spline basis matrix. This allows data to extend beyond the boundary knots, or for the basis parameters to not depend onx.The default (boundaries=NULL) is the range ofx.

Value

A spline basis matrix with number of rows equal tolength(x) and the number of columns equal to the numberof coefficients in the spline.

Examples

x <- 0:100genspline(x)# Generate a quadratic B-spline with 1 equally spaced internal knotgenspline(x, spline="bs", knots=2, degree=2)# Generate a natural cubic spline with 3 knots at selected quantilesgenspline(x, spline="ns", knots=c(0.1, 0.5, 0.7))# Generate a piecewise linear spline with 3 equally spaced knotsgenspline(x, spline="ls", knots=3)

Get current priors from JAGS model code

Description

Identical toget.prior() inMBNMAtime package.This function takes JAGS model presented as a string and identifies whatprior values have been used for calculation.

Usage

get.prior(model)

Arguments

model

A character object of JAGS MBNMA model code

Details

Even if an MBNMA model that has not initialised successfully andresults have not been calculated, the JAGS model for it is saved inmbnma$model.arg$jagscode and therefore priors can still be obtained.This allows for priors to be changed even in failing models, which may helpsolve issues with compiling or updating.

Value

A character vector, each element of which is a line of JAGS codecorresponding to a prior in the JAGS code.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMAresult <- mbnma.run(network, fun=demax(), method="random")# Obtain model prior valuesprint(result$model.arg$priors)# Priors when using mbnma.run with an exponential functionresult <- mbnma.run(network, fun=dexp(), method="random")print(result$model.arg$priors)

Calculates league table of effects between treatments in MBNMA and/or NMA models

Description

Calculates league table of effects between treatments in MBNMA and/or NMA models

Usage

get.relative(  lower.diag,  upper.diag = lower.diag,  treatments = list(),  lower.direction = "colvrow",  upper.direction = "rowvcol",  regress.vals = NULL,  eform = FALSE,  lim = "cred")

Arguments

lower.diag

An S3 object either of class"mbnma" generated by runninga dose-response MBNMA model (usingmbnma.run()), or ofclass"nma" generated by running an NMA model (usingnma.run()). Indicates thatthis model should be used to estimate treatment effects in thelower-left diagonal of the league table.

upper.diag

Same as forlower.diag, but indicates that this model should be usedto estimate treatment effects in theupper-right diagonal of the league table.

treatments

A list whose elements each represent different treatments.Treatment is defined as a combination of agent and dose. Only agents specified inlower.diag andupper.diag can be included. Each element intreatments is named corresponding to theagent and contains a numeric vector of doses. Relative effects will be calculated betweenall treatments specified intreatments. Iftreatments is left empty then the set oftreatments in the network on whichlower.diag is estimated will be used as the default.

lower.direction

Whether treatment effects should be presented as the column versus the row treatmentfor each cell in thelower-left diagonal of the league table ("colvrow") or as the row versus thecolumn treatment ("rowvcol").

upper.direction

Same as forupper.direction but for results shown in theupper-right diagonal ofthe league table.

regress.vals

A named numeric vector of effect modifier values at which relative effectsshould be estimated. Named elements must match variable names specified in regression design matrix(mbnma$model.arg$regress.mat), corresponding to variables inregress withinthe MBNMA model (orboth MBNMA models if different models are used forupper.diagandlower.diag. Meta-regression is not currently possible for NMA models, so onlyunadjusted results will be shown for these (and a warning given if they are compared toadjusted MBNMA results).

eform

Whether outputted results should be presented in their exponential form (e.g. formodels with log or logit link functions)

lim

Specifies calculation of either 95% credible intervals (lim="cred") or 95% prediction intervals (lim="pred").

Value

An array of⁠length(treatments) x length(treatments) x nsims⁠, wherensimsis the number of iterations monitored inlower.diag. The array contains the individualMCMC values for each relative effect calculated between alltreatments on the link scalespecified in thelower.diag andupper.diag models.

Examples

# Using the osteoarthritis datanetwork <- mbnma.network(osteopain)# Run an MBNMA modelexpon <- mbnma.run(network, fun=dexp(), method="random")# Calculate relative effects for MBNMA between:# Celebrex 100mg/d, Celebrex 200mg/d, Tramadol 100mg/drel.eff <- get.relative(lower.diag=expon,  treatments=list("Celebrex"=c(100,200), "Tramadol"=100))# Run an NMA modelnma <- nma.run(network, method="random")# Compare results between MBNMA and NMA modelsrel.eff <- get.relative(lower.diag=expon, upper.diag=nma,  treatments=list("Celebrex"=c(100,200), "Tramadol"=100),  upper.direction="colvrow")

Prepares data for JAGS

Description

Converts MBNMA data frame to a list for use in JAGS model

Usage

getjagsdata(  data.ab,  class = FALSE,  sdscale = FALSE,  regress = NULL,  regress.effect = "common",  likelihood = check.likelink(data.ab)$likelihood,  link = check.likelink(data.ab)$link,  level = "agent",  fun = NULL,  nodesplit = NULL)

Arguments

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifiermust also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardisetreatment effects when modelling using Standardised Mean Differences (SMD).

class

A boolean object indicating whether or notdata.ab containsinformation on different classes of treatments

sdscale

Logical object to indicate whether to write a model that specifies a reference SDfor standardising when modelling using Standardised Mean Differences. Specifyingsdscale=TRUEwill therefore only modify the model if link function is set to SMD (link="smd").

regress

A formula of effect modifiers (variables thatinteract with the treatment effect) to incorporate using Network Meta-Regression(E.g.~ Population + Age). All variables in the formula are modelled as interactingwith the treatment effect (i.e. prognostic variables cannot be included in this way).Effects modifiers must be named variables innetwork$data.ab and must be identicalwithin a study. Factor and character effect modifiers will be converted to a series ofnamed dummy variables.

regress.effect

Indicates whether effect modification should be assumed to be"common" (assumed to be equal versus Placebo throughout the network),"random" (assumed to be exchangeable versus Placebo throughout the network),"agent" (assumed to be equal versus Placebo within each agent), or"class" (assumed to be equal versus Placebo within each class).

likelihood

A string indicating the likelihood to use in the model. Can take either"binomial","normal" or"poisson". If left asNULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

level

Can take either"agent" to indicate that data should be at the agent-level (for MBNMA) or"treatment" to indicate that data should be at the treatment-level (for NMA)

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

nodesplit

A numeric vector of length 2 containing treatment codes on which to performan MBNMA nodesplit (seembnma.nodesplit).

Value

A named list of numbers, vector, matrices and arrays to be sent toJAGS. List elements are:

Examples

# Using the triptans headache datasetnetwork <- mbnma.network(triptans)jagsdat <- getjagsdata(network$data.ab, likelihood="binomial", link="logit")# Get JAGS data with classnetclass <- mbnma.network(osteopain)jagsdat <- getjagsdata(netclass$data.ab, class=TRUE)# Get JAGS data at the treatment level for split Network Meta-Analysisnetwork <- mbnma.network(triptans)jagsdat <- getjagsdata(network$data.ab, level="treatment")

Studies of treatments for Serum Uric Acid reduction in patients with gout

Description

A dataset from a systematic review of interventions for lowering Serum Uric Acid (SUA) concentration inpatients with gout(not published previously). The outcome is continuous, and aggregate data responsescorrespond to the mean change from baseline in SUA in mg/dL at 2 weeks follow-up. The dataset includes 10Randomised-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 totalthere were 19 different treatments (combination of dose and agent).

Usage

gout

Format

A data frame in long format (one row per arm and study), with 27 rows and 5 variables:

Source

Pfizer Ltd.


Identify comparisons in loops that fulfill criteria for node-splitting

Description

Identify comparisons informed by both direct and indirect evidence fromindependent sources, which therefore fulfill the criteria for testing forinconsistency via node-splitting.

Usage

inconsistency.loops(df, checkindirect = TRUE, incldr = FALSE)

Arguments

df

A data frame containing variablesstudyID andtreatment (asnumeric codes) that indicate which treatments are used in which studies. Ifcheckindirect = TRUEthen variablesagent anddose are also required.

checkindirect

A boolean object to indicate whether or not to perform an additionalcheck to ensure network remains connected even after dropping direct evidence on a comparison.Default isTRUE and should be kept asTRUE if working with dose-response data, though this requiresfurther computational iterations to confirm. If set toFALSE, additional comparisons may be identified, though computation will be much morerapid.

incldr

A boolean object indicating whether or not to allow for indirect evidence contributions viathe dose-response relationship. This can be used when node-splitting in dose-response MBNMA to allowfor a greater number of potential loops in which to check for consistency.

Details

Similar togemtc::mtc.nodesplit.comparisons() but uses a fixedreference treatment and therefore identifies fewer loops in which to test forinconsistency. Heterogeneity can also be parameterised as inconsistency andso testing for inconsistency in additional loops whilst changing thereference treatment would also be identifying heterogeneity. Depends onigraph.

Value

A data frame of comparisons that are informed by direct and indirectevidence from independent sources. Each row of the data frame is adifferent treatment comparison. Numerical codes int1 andt2 correspondto treatment codes.path indicates the treatment codes that connect theshortest path of indirect evidence.

Ifincldr=TRUE thenpath may indicatedoseresp for some comparisons.These are comparisons for which indirect evidence is only available via thedose-response relationship. The two numbers given after (e.g.⁠3 2⁠) indicate thenumber of doses available in the indirect evidence with which to estimate thedose-response function for the treatments int1 andt2 respectively/

References

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.

Examples

# Identify comparisons informed by direct and indirect evidence#in triptans datasetnetwork <- mbnma.network(triptans)inconsistency.loops(network$data.ab)# Include indirect evidence via dose-response relationshipinconsistency.loops(network$data.ab, incldr=TRUE)# Do not perform additional connectivity check on datadata <- data.frame(studyID=c(1,1,2,2,3,3,4,4,5,5,5),            treatment=c(1,2,1,3,2,3,3,4,1,2,4)            )inconsistency.loops(data, checkindirect=FALSE)

Identify unique comparisons within a network

Description

Identify unique contrasts within a network that make up all the head-to-head comparisons. Repetitionsof the same treatment comparison are grouped together.

Usage

mbnma.comparisons(df)

Arguments

df

A data frame containing variablesstudyID andtreatment (as numeric codes) thatindicate which treatments are used in which studies.

Value

A data frame of unique comparisons in which each row represents a different comparison.t1 andt2 indicate the treatment codes that make up the comparison.nr indicates the numberof 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 standardnetwork meta-analysis)nr will represent the number of studies that compare treatmentst1 andt2.

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 treatmentst1 andt2 arecompared.

Examples

df <- data.frame(studyID=c(1,1,2,2,3,3,4,4,5,5,5),  treatment=c(1,2,1,3,2,3,3,4,1,2,4)  )# Identify unique comparisons within the datambnma.comparisons(df)# Using the triptans headache datasetnetwork <- mbnma.network(triptans) # Adds treatment identifiersmbnma.comparisons(network$data.ab)

Node-splitting model for testing consistency at the treatment level using MBNMA

Description

Splits contributions for a given set of treatment comparisons into direct andindirect evidence. A discrepancy between the two suggests that the consistencyassumption required for NMA and MBNMA may violated.

Usage

mbnma.nodesplit(  network,  fun = dpoly(degree = 1),  method = "common",  comparisons = NULL,  incldr = TRUE,  ...)## S3 method for class 'nodesplit'plot(x, plot.type = "forest", ...)

Arguments

network

An object of classmbnma.network.

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

method

Can take either"common" or"random" to indicate whether relative effectsshould be modelled with between-study heterogeneity or not (see details).

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 caneither be character (corresponding to the treatment names given innetwork) ornumeric (corresponding to treatment codes within thenetwork - note that thesemay change ifdrop.discon = TRUE).

incldr

A boolean object indicating whether or not to allow for indirect evidence contributions viathe dose-response relationship. This can be used when node-splitting in dose-response MBNMA to allowfor a greater number of potential loops in which to check for consistency.

...

Arguments to be sent toggplot2::ggplot() orforestplot::forestplot()

x

An object ofclass("nodesplit")

plot.type

A character string that can take the value of"forest" to plotforest plots or"density" to plot posterior density plots.

Details

The S3 methodplot() on annodesplit object generates eitherforest plots of posterior medians and 95\% credible intervals, or density plotsof posterior densities for direct and indirect evidence.

Value

Plots the desired graph ifplot.type="forest" and plots and returns an objectofclass(c("gg", "ggplot")) ifplot.type="density".

Functions

Examples

# Using the triptans datanetwork <- 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 relationshiploops <- 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 resultsplot(split, plot.type="density") # Plot density plots of posterior densitiesplot(split, txt_gp=forestplot::fpTxtGp(cex=0.5)) # Plot forest plots (with smaller label size)# Print and summarise resultsprint(split)summary(split) # Generate a data frame of summary results

Run MBNMA dose-response models

Description

Fits a Bayesian dose-response for model-based network meta-analysis(MBNMA) that can account for multiple doses of different agents byapplying a desired dose-response function. Follows the methodsof Mawdsley et al. (2016).

Usage

mbnma.run(  network,  fun = dpoly(degree = 1),  method = "common",  regress = NULL,  regress.effect = "common",  class.effect = list(),  UME = FALSE,  sdscale = FALSE,  cor = FALSE,  omega = NULL,  parameters.to.save = NULL,  pD = TRUE,  likelihood = NULL,  link = NULL,  priors = NULL,  n.iter = 20000,  n.chains = 3,  n.burnin = floor(n.iter/2),  n.thin = max(1, floor((n.iter - n.burnin)/1000)),  autojags = FALSE,  Rhat = 1.05,  n.update = 10,  model.file = NULL,  jagsdata = NULL,  ...)

Arguments

network

An object of classmbnma.network.

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

method

Can take either"common" or"random" to indicate whether relative effectsshould be modelled with between-study heterogeneity or not (see details).

regress

A formula of effect modifiers (variables thatinteract with the treatment effect) to incorporate using Network Meta-Regression(E.g.~ Population + Age). All variables in the formula are modelled as interactingwith the treatment effect (i.e. prognostic variables cannot be included in this way).Effects modifiers must be named variables innetwork$data.ab and must be identicalwithin a study. Factor and character effect modifiers will be converted to a series ofnamed dummy variables.

regress.effect

Indicates whether effect modification should be assumed to be"common" (assumed to be equal versus Placebo throughout the network),"random" (assumed to be exchangeable versus Placebo throughout the network),"agent" (assumed to be equal versus Placebo within each agent), or"class" (assumed to be equal versus Placebo within each class).

class.effect

A list of named strings that determines which dose-responseparameters to model with a class effect and what that effect should be("common" or"random"). Element names should match dose-response parameter names.Note that assuming class effects on some dose-response parameters may be unreasonable ifthe range of doses differ substantially across agents within a class.

UME

A boolean object to indicate whether to fit an Unrelated Mean Effects modelthat does not assume consistency and so can be used to test if the consistencyassumption is valid.

sdscale

Logical object to indicate whether to write a model that specifies a reference SDfor standardising when modelling using Standardised Mean Differences. Specifyingsdscale=TRUEwill therefore only modify the model if link function is set to SMD (link="smd").

cor

A boolean object that indicates whether correlation should be modelledbetween relative effect dose-response parameters. This isautomatically set toFALSE if class effects are modelled or if multiple dose-responsefunctions are fitted.

omega

A scale matrix for the inverse-Wishart prior for the covariance matrix usedto model the correlation between dose-response parameters (see Details for dose-response functions).omega mustbe a symmetric positive definite matrix with dimensions equal to the number of dose-response parameters modelled usingrelative effects ("rel"). If left asNULL (the default) a diagonal matrix with elements equal to 100is used.

parameters.to.save

A character vector containing names of parametersto monitor in JAGS

pD

logical; ifTRUE (the default) then adds the computation of pD, using the methodof (Plummer 2008). IfFALSE then uses theapproximation ofpD=var(deviance) / 2 (often referred to as pV).

likelihood

A string indicating the likelihood to use in the model. Can take either"binomial","normal" or"poisson". If left asNULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

priors

A named list of parameter values (without indices) andreplacement prior distribution values given as stringsusing distributions as specified in JAGS syntax (see Plummer (2017)). Notethat normal distributions in JAGS are specified as

N(\mu, prec)

, where

prec = 1 / {\sigma^2}

.

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 thebeginning. Default is 'n.iter/2“, that is, discarding the first half of thesimulations. If n.burnin is 0, jags() will run 100 iterations for adaption.

n.thin

thinning rate. Must be a positive integer. Set⁠n.thin > 1`` to save memory and computation time if n.iter is large. Default is ⁠max(1, floor(n.chains * (n.iter-n.burnin) / 1000))“ which will only thin if there are at least 2000simulations.

autojags

A boolean value that indicates whether the model should be continually updated untilit has converged below a specific cutoff ofRhat

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 upto a maximum ofn.update. Default is1.05.

n.update

The maximum number of updates. Each update is run for 1000 iterations, after which theRhat values of all parameters are checked againstRhat. Default maximum updatesis10 (i.e. 10,000 additional iterations in total).

model.file

The file path to a JAGS model (.jags file) that can be usedto overwrite the JAGS model that is automatically written based on thespecified options inMBNMAdose. Useful for adding further model flexibility.

jagsdata

A named list of the data objects to be used in the JAGS model. Onlyrequired if users are defining their own JAGS model usingmodel.file. Formatshould match that of standard models fitted inMBNMAdose(seembnma$model.arg$jagsdata)

...

Arguments to be sent to R2jags.

Details

When relative effects are modelled on more than one dose-response parameter andcor = TRUE, correlation between the dose-response parameters is automaticallyestimated using a vague Wishart prior. This prior can be made slightly more informativeby specifying the relative scale of variances between the dose-response parameters usingomega.cor will automatically be set toFALSE if class effects are modelled.

Value

An object of S3class(c("mbnma", "rjags")) containing parameterresults from the model. Can be summarized byprint() and can checktraceplots usingR2jags::traceplot() or various functions from the packagemcmcplots.

Nodes that are automatically monitored (if present in the model) have thefollowing interpretation:

Parameters(s)/Parameter PrefixInterpretation
⁠<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 ifmethod="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 inclass.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 inclass.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 listconsisting of two elements - an error message from JAGS that can help withdebugging andmodel.arg, a list of arguments provided tombnma.run()which includesjagscode, the JAGS code for the model that can helpusers identify the source of the error.

Dose-response parameter arguments

ArgumentModel specification
"rel" Implies thatrelative effects should be pooled for this dose-response parameter separately for each agent in the network.
"common" Implies that all agents share the same common effect for this dose-response parameter.
"random" Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents.
numeric() Assigned a numeric value, indicating that this dose-response parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific dose-response parameters (e.g. Hill parameters in Emax functions) to a single value.

Dose-response function

Several general dose-response functions are provided, but auser-defined dose-response relationship can instead be used.

As of version 0.4.0 dose-response functions are specified as an object ofclass("dosefun"). Seehelp details for each of the functions below for the interpretation of specific dose-response parameters.

Built-in dose-response functions are:

References

Gelman A, Rubin DB (1992).“Inference from iterative simulation using multiple sequences.”Statistical Science,7(4), 457-511.https://projecteuclid.org/journals/statistical-science/volume-7/issue-4/Inference-from-Iterative-Simulation-Using-Multiple-Sequences/10.1214/ss/1177011136.full.

Mawdsley D, Bennetts M, Dias S, Boucher M, Welton NJ (2016).“Model-Based Network Meta-Analysis: A Framework for Evidence Synthesis of Clinical Trial Data.”CPT Pharmacometrics Syst Pharmacol,5(8), 393-401.ISSN 2163-8306 (Electronic) 2163-8306 (Linking),doi:10.1002/psp4.12091,https://pubmed.ncbi.nlm.nih.gov/27479782/.

Owen RK, Tincello DG, Keith RA (2015).“Network meta-analysis: development of a three-level hierarchical modeling approach incorporating dose-related constraints.”Value Health,18(1), 116-26.ISSN 1524-4733 (Electronic) 1098-3015 (Linking),doi:10.1016/j.jval.2014.10.006,https://pubmed.ncbi.nlm.nih.gov/25595242/.

Plummer M (2008).“Penalized loss functions for Bayesian model comparison.”Biostatistics,9(3), 523-39.ISSN 1468-4357 (Electronic) 1465-4644 (Linking),https://pubmed.ncbi.nlm.nih.gov/18209015/.

Plummer M (2017).JAGS user manual.https://people.stat.sc.edu/hansont/stat740/jags_user_manual.pdf.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)######## Dose-response functions ######### Fit a dose-response MBNMA with a linear function# with common treatment effectsresult <- mbnma.run(network, fun=dpoly(degree=1), method="common")# Fit a dose-response MBNMA with a log-linear function# with random treatment effectsresult <- 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 functionresult <- 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 effectsresult <- 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 effectsresult <- 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 rangesdepnet <- mbnma.network(ssri) # Using the sSRI depression datasetresult <- 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 agentmultifun <- 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 rizatriptanmultidose <- 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 functionresult <- mbnma.run(network, fun=dfpoly(degree=1), method="random")print(result$model.arg$priors)# Change the prior distribution for the powernewpriors <- 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 thinresult <- mbnma.run(network, fun=dloglin(), method="random",              n.iter=5000, n.thin=5, n.chains=4)####### Examine MCMC diagnostics (using mcmcplots or coda packages) ######## Density plotsmcmcplots::denplot(result)# Traceplotsmcmcplots::traplot(result)# Caterpillar plotsmcmcplots::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 parametersconv.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 summaryprint(result)summary(result)# Plot forest plot of resultsplot(result)

Update MBNMA to monitor deviance nodes in the model

Description

Useful for obtaining deviance contributions or fitted values. Same function used in MBNMAdose and MBNMAtime packages.

Usage

mbnma.update(  mbnma,  param = "theta",  armdat = TRUE,  n.iter = mbnma$BUGSoutput$n.iter,  n.thin = mbnma$BUGSoutput$n.thin)

Arguments

mbnma

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

param

Used to indicate which node to monitor in the model. Can be any parameterin the model code that varies by all arms within all studies. These are some typicalparameters that it might be of interest to monitor, provided they are in the originalmodel code:

  • "theta" for fitted values

  • "psi" for fitted values on natural scale (e.g. probabilities)

  • "dev" for deviance contributions

  • "resdev" for residual deviance contributions

  • "delta" for within-study relative effects versus the study reference treatment

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. Setn.thin > 1 to save memory and computation time ifn.iter is large. Default ismax(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are atleast 2000 simulations.

Value

A data frame containing the posterior mean of the updates by arm and study,with arm and study identifiers.

For MBNMAdose:

For MBNMAtime:

Examples

# Using the triptans datanetwork <- 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 thetambnma.update(result, param="rhat") # monitor rhatmbnma.update(result, param="delta") # monitor delta

Validates that a dataset fulfills requirements for MBNMA

Description

Validates that a dataset fulfills requirements for MBNMA

Usage

mbnma.validate.data(data.ab, single.arm = FALSE)

Arguments

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifiermust also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardisetreatment effects when modelling using Standardised Mean Differences (SMD).

single.arm

A boolean object to indicate whether to allow single arm studies in the dataset (TRUE)or not (FALSE)

Details

Checks done within the validation:

Value

An error if checks are not passed. Runs silently if checks are passed


Write MBNMA dose-response model JAGS code

Description

Writes JAGS code for a Bayesian time-course model for model-based networkmeta-analysis (MBNMA).

Usage

mbnma.write(  fun = dpoly(degree = 1),  method = "common",  regress.mat = NULL,  regress.effect = "common",  sdscale = FALSE,  cor = FALSE,  cor.prior = "wishart",  omega = NULL,  om = list(rel = 5, abs = 10),  class.effect = list(),  UME = FALSE,  likelihood = "binomial",  link = NULL)

Arguments

fun

An object ofclass("dosefun") that specifies a functional form to be assigned to thedose-response. See Details.

method

Can take either"common" or"random" to indicate whether relative effectsshould be modelled with between-study heterogeneity or not (see details).

regress.mat

A Nstudy x Ncovariate design matrix of meta-regression covariates

regress.effect

Indicates whether effect modification should be assumed to be"common" (assumed to be equal versus Placebo throughout the network),"random" (assumed to be exchangeable versus Placebo throughout the network),"agent" (assumed to be equal versus Placebo within each agent), or"class" (assumed to be equal versus Placebo within each class).

sdscale

Logical object to indicate whether to write a model that specifies a reference SDfor standardising when modelling using Standardised Mean Differences. Specifyingsdscale=TRUEwill therefore only modify the model if link function is set to SMD (link="smd").

cor

A boolean object that indicates whether correlation should be modelledbetween relative effect dose-response parameters. This isautomatically set toFALSE if class effects are modelled or if multiple dose-responsefunctions are fitted.

cor.prior

NOT CURRENTLY IN USE - indicates the prior distribution to use for the correlation/covariancebetween relative effects. Must be kept as"wishart"

omega

A scale matrix for the inverse-Wishart prior for the covariance matrix usedto model the correlation between dose-response parameters (see Details for dose-response functions).omega mustbe a symmetric positive definite matrix with dimensions equal to the number of dose-response parameters modelled usingrelative effects ("rel"). If left asNULL (the default) a diagonal matrix with elements equal to 100is used.

om

a list with two elements that report the maximum relative ("rel") and maximum absolute ("abs") efficacieson the link scale.

class.effect

A list of named strings that determines which dose-responseparameters to model with a class effect and what that effect should be("common" or"random"). Element names should match dose-response parameter names.Note that assuming class effects on some dose-response parameters may be unreasonable ifthe range of doses differ substantially across agents within a class.

UME

A boolean object to indicate whether to fit an Unrelated Mean Effects modelthat does not assume consistency and so can be used to test if the consistencyassumption is valid.

likelihood

A string indicating the likelihood to use in the model. Can take either"binomial","normal" or"poisson". If left asNULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

Details

When relative effects are modelled on more than one dose-response parameter andcor = TRUE, correlation between the dose-response parameters is automaticallyestimated using a vague Wishart prior. This prior can be made slightly more informativeby specifying the relative scale of variances between the dose-response parameters usingomega.cor will automatically be set toFALSE if class effects are modelled.

Value

A single long character string containing the JAGS model generatedbased on the arguments passed to the function.

Examples

# Write model code for a model with an exponential dose-response function,# with random treatment effectsmodel <- mbnma.write(fun=dexp(),             method="random",             likelihood="binomial",             link="logit"             )names(model) <- NULLprint(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 modelmodel <- mbnma.write(fun=demax(emax="rel", ed50="common"),             likelihood="normal",             link="identity"             )names(model) <- NULLprint(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 effectsmodel <- mbnma.write(fun=demax(),             likelihood="normal",             link="identity",             class.effect=list("ed50"="common")             )names(model) <- NULLprint(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) <- NULLprint(model)

Node-splitting model for testing consistency at the treatment-level

Description

Splits contributions for a given set of treatment comparisons into direct andindirect evidence. A discrepancy between the two suggests that the consistencyassumption required for NMA (and subsequently MBNMA) may violated.

Usage

nma.nodesplit(  network,  likelihood = NULL,  link = NULL,  method = "common",  comparisons = NULL,  drop.discon = TRUE,  ...)## S3 method for class 'nma.nodesplit'plot(x, plot.type = NULL, ...)

Arguments

network

An object of classmbnma.network.

likelihood

A string indicating the likelihood to use in the model. Can take either"binomial","normal" or"poisson". If left asNULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

method

Can take either"common" or"random" to indicate whether relative effectsshould be modelled with between-study heterogeneity or not (see details).

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 caneither be character (corresponding to the treatment names given innetwork) ornumeric (corresponding to treatment codes within thenetwork - note that thesemay change ifdrop.discon = TRUE).

drop.discon

A boolean object that indicates whether to drop treatmentsthat are disconnected at the treatment level. Default isTRUE. If set toFALSE thenthis could lead to identification of nodesplit comparisons that are not connectedto the network reference treatment, or lead to errors in running the nodesplit models, though itcan be useful for error checking.

...

Arguments to be sent toggplot2::ggplot()

x

An object ofclass("nma.nodesplit")

plot.type

A character string that can take the value of"forest" to plotonly forest plots,"density" to plot only density plots, or left asNULL (thedefault) to plot both types of plot.

Details

The S3 methodplot() on annma.nodesplit object generates eitherforest plots of posterior medians and 95\% credible intervals, or density plotsof posterior densities for direct and indirect evidence.

Value

Plots the desired graph(s) and returns an object (or list of object ifplot.type=NULL) ofclass(c("gg", "ggplot"))

Methods (by generic)

Examples

# Using the triptans datanetwork <- 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 sourcesloops <- 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 resultsplot(split, plot.type="density") # Plot density plots of posterior densitiesplot(split, plot.type="forest") # Plot forest plots of direct and indirect evidence# Print and summarise resultsprint(split)summary(split) # Generate a data frame of summary results

Convert normal distribution parameters to corresponding log-normal distribution parameters

Description

Converts mean and variance of normal distribution to the parameters for a log-normaldistribution with the same mean and variance

Usage

norm2lnorm(m, v)

Arguments

m

Mean of the normal distribution

v

Variance of the normal distribution

Value

A vector of length two. The first element is the mean and the second element is the varianceof the log-normal distribution

Examples

norm <- rnorm(1000, mean=5, sd=2)params <- norm2lnorm(5, 2^2)lnorm <- rlnorm(1000, meanlog=params[1], sdlog=params[2]^0.5)# Mean and SD of lnorm is equivalent to mean and sd of normmean(lnorm)sd(lnorm)

Studies of treatments for pain relief in patients with osteoarthritis

Description

A dataset from a systematic review of interventions for pain relief in osteoarthritis, used previouslyin Pedder et al. (2019). The outcome is continuous, and aggregate data responses correspond tothe 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 andagent). The active treatments can also be grouped into 3 different classes, within which they have similarmechanisms of action.

Usage

osteopain

Format

A data frame in long format (one row per arm and study), with 74 rows and 7 variables:

Source

Pfizer Ltd.

References

Pedder H, Dias S, Bennetts M, Boucher M, Welton NJ (2019).“Modelling time-course relationships with multiple treatments: Model-Based Network Meta-Analysis for continuous summary outcomes.”Res Synth Methods,10(2), 267-286.


Calculate plugin pD from a JAGS model with univariate likelihood for studieswith repeated measurements

Description

Uses results from MBNMA JAGS models to calculate pD via theplugin method (Spiegelhalter et al. 2002). Can only be used for models with knownstandard errors or covariance matrices. Currently only functions with univariate likelihoods. Functionis identical in MBNMAdose and MBNMAtime packages.

Usage

pDcalc(  obs1,  obs2,  fups = NULL,  narm,  NS,  theta.result,  resdev.result,  likelihood = "normal",  type = "time")

Arguments

obs1

A matrix (study x arm) or array (study x arm x time point) containingobserved data fory (normal likelihood) orr (binomial or poisson likelihood)in each arm of each study. This will be the same arrayused as data for the JAGS model.

obs2

A matrix (study x arm) or array (study x arm x time point) containingobserved data forse (normal likelihood),n (binomial likelihood) orE (poisson likelihood)in each arm of each study. This will be the same arrayused as data for the JAGS model.

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 fortime-course MBNMA models (iftype="time")

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 eachstudy. 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 eachstudy. This will be estimated by the JAGS model.

likelihood

A character object of any of the following likelihoods:

  • normal

  • binomial (does not work with time-course MBNMA models)

  • poisson (does not work with time-course MBNMA models)

type

The type of MBNMA model fitted. Can be either"time" or"dose"

Details

Method for calculating pD via the plugin method proposed bySpiegelhalter (Spiegelhalter et al. 2002). Standard errors / covariance matrices must be assumedto be known. To obtain values fortheta.result andresdev.result theseparameters must be monitored when running the MBNMA model (usingparameters.to.save).

For non-linear time-course MBNMA models residual deviance contributions may be skewed, whichcan lead to non-sensical results when calculating pD via the plugin method.Alternative approaches are to use pV as an approximation orpD calculated by Kullback-Leibler divergence (Plummer 2008).

Value

A single numeric value for pD calculated via the plugin method.

References

Plummer M (2008).“Penalized loss functions for Bayesian model comparison.”Biostatistics,9(3), 523-39.ISSN 1468-4357 (Electronic) 1465-4644 (Linking),https://pubmed.ncbi.nlm.nih.gov/18209015/.

Spiegelhalter DJ, Best NG, Carlin BP, van der Linde A (2002).“Bayesian measures of model complexity and fit.”J R Statistic Soc B,64(4), 583-639.

Examples

# Using the triptans datanetwork <- 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 calculationr <- result$model$data()$rn <- result$model$data()$nnarm <- result$model$data()$narmNS <- result$model$data()$NSpsi <- result$BUGSoutput$median$psiresdevs <- result$BUGSoutput$median$resdev# Calculate pD via plugin methodpD <- pDcalc(obs1=r, obs2=n, narm=narm, NS=NS,          theta.result=psi, resdev.result=resdevs,          likelihood="binomial", type="dose")

Forest plot for results from dose-response MBNMA models

Description

Generates a forest plot for dose-response parameters.

Usage

## S3 method for class 'mbnma'plot(x, params = NULL, ...)

Arguments

x

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

params

A character vector of dose-response parameters to plot.Parameters must be given the same name as monitored nodes inmbnma and must bemodelled as relative effects ("rel"). Can be set toNULL to include all available dose-response parameters estimated bymbnma.

...

Arguments to be passed to methods, such as graphical parameters

Value

A forest plot of classc("gg", "ggplot") that has separate panels fordifferent dose-response parameters. Results are plotted on the link scale.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an exponential dose-response MBNMA and generate the forest plotexponential <- mbnma.run(network, fun=dexp())plot(exponential)# Plot only Emax parameters from an Emax dose-response MBNMAemax <- mbnma.run(network, fun=demax(), method="random")plot(emax, params=c("emax"))#### Forest plots including class effects ##### Generate some classes for the dataclass.df <- triptansclass.df$class <- ifelse(class.df$agent=="placebo", "placebo", "active1")class.df$class <- ifelse(class.df$agent=="eletriptan", "active2", class.df$class)netclass <- mbnma.network(class.df)emax <- mbnma.run(netclass, fun=demax(), method="random",            class.effect=list("ed50"="common"))

Create an mbnma.network object

Description

Creates an object ofclass("mbnma.network"). Various MBNMA functions can subsequently be appliedto this object.

Usage

## S3 method for class 'mbnma.network'plot(  x,  level = "treatment",  v.color = "connect",  doselink = NULL,  layout = igraph::in_circle(),  remove.loops = FALSE,  edge.scale = 1,  v.scale = NULL,  label.distance = 0,  legend = TRUE,  legend.x = "bottomleft",  legend.y = NULL,  ...)mbnma.network(data.ab, description = "Network")

Arguments

x

An object of classmbnma.network.

level

A string indicating whether nodes/facets should represent"treatment"or"agent" in the plot. Can be used to examine the expected impact of modellingdose-response in terms of network connectivity.

v.color

Can take either"connect" (the default) to indicate that nodes shouldonly be coloured if they are connected to the network reference treatment (indicatesnetwork connectivity) or"agent" to colour nodes by agent.

doselink

If given an integer value it indicates that connections via the dose-responserelationship with placebo should be plotted. The integer represents the minimum number of dosesfrom which a dose-response function could be estimated and is equivalent to the number ofparameters in the desired dose-response function plus one. If left asNULL (the default), connectionsto placebo via dose-response relationships will not be included.

layout

An igraph layout specification. This is a function specifying an igraphlayout that determines the arrangement of the vertices (nodes). The defaultigraph::as_circle() arranged vertices in a circle. Two other useful layouts fornetwork plots are:igraph::as_star(),igraph::with_fr(). Others can be foundinlayout_

remove.loops

A boolean value indicating whether to include loops thatindicate 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 agiven 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 variableN(to indicate the numbers of participants in each study arm) is included in thedataset then the size of the nodes will be proportional to the number of participantswithin a treatment/agent in the network.

label.distance

A number scaling the distance of labels from the nodesto improve readability. The labels will be directly on top of the nodes ifthe default of 0 is used. Option only applicable iflayout_in_circle isset toTRUE.

legend

A boolean object to indicate whether or not to plot a legend to indicate which node colourcorresponds to which agent ifv.color="agent". Default isTRUE.

legend.x,legend.y

The x and y co-ordinates to be used to position the legend. They can be specifiedby keyword or in any way which is accepted byxy.coords.

...

Options for plotting inigraph.

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifiermust also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardisetreatment effects when modelling using Standardised Mean Differences (SMD).

description

Optional. Short description of the network.

Details

The S3 methodplot() on anmbnma.network object generates anetwork plot that shows how different treatments are connected within thenetwork via study comparisons. This can be used to identify how direct andindirect evidence are informing different treatment comparisons. Depends onigraph.

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 cannotbe included.

Value

plot(): An object ofclass("igraph") - any functions from theigraph packagecan be applied to this object to change its characteristics.

mbnma.network(): An object ofclass("mbnma.network") which is a list containing:

Methods (by generic)

Examples

# Create an mbnma.network object from the datanetwork <- mbnma.network(triptans)# Generate a network plot from the dataplot(network)# Generate a network plot at the agent level that removes loops indicating comparisons#within a nodeplot(network, level="agent", remove.loops=TRUE)# Generate a network plot at the treatment level that colours nodes by agentplot(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 centreplot(network, layout=igraph::as_star(), label.distance=3)#### Plot a network with no placebo data included ##### Make data with no placebonoplac.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-responseplot(net.noplac)# Using the triptans headache datasetprint(triptans)# Define networknetwork <- mbnma.network(triptans, description="Example network")summary(network)plot(network)

Plots predicted responses from a dose-response MBNMA model

Description

Plots predicted responses on the natural scale from a dose-response MBNMA model.

Usage

## S3 method for class 'mbnma.predict'plot(  x,  disp.obs = FALSE,  overlay.split = FALSE,  method = "common",  agent.labs = NULL,  scales = "free_x",  ...)

Arguments

x

An object of class"mbnma.predict" generated bypredict("mbnma")

disp.obs

A boolean object to indicate whether to show the location of observed dosesin the data on the 95\% credible intervals of the predicted dose-response curves as shaded regions (TRUE)or not (FALSE). If set toTRUE the original network object used for the modelmust be specified innetwork.

overlay.split

A boolean object indicating whether to overlay a lineshowing the split (treatment-level) NMA results on the plot (TRUE) or not (FALSE). This willrequire automatic running of a split NMA model.Foroverlay.split=TRUE the original network object used for the modelmust be specified innetwork.

method

Indicates the type of split (treatment-level) NMA to perform whenoverlay.split=TRUE. Cantake either"common" or"random".

agent.labs

A character vector of agent labels to display on plots. Ifleft asNULL (the default) the names of agents will be taken frompredict. The position ofeach label corresponds to each element ofpredict. The number of labels must equalthe number of active agents inpredict. If placebo / dose=0 data is included in the predictionsthen a label for placeboshould not be included inagent.labs. It will not be shownin the final plot since placebo is the point within each plot at which dose = 0 (ratherthan a separate agent).

scales

Should scales be fixed ("fixed", the default),free ("free"), or free in one dimension ("free_x","free_y")?

...

Arguments forggplot2

Details

For the S3 methodplot(), it is advisable to ensure predictions inpredict are estimated using a sufficient number of doses to ensure a smoothpredicted dose-response curve. Ifdisp.obs = TRUE it isadvisable to ensure predictions inpredict are estimated using an evensequence of time points to avoid misrepresentation of shaded densities.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMA and predict responsesemax <- mbnma.run(network, fun=demax(), method="random")pred <- predict(emax, E0 = 0.5)plot(pred)# Display observed doses on the plotplot(pred, disp.obs=TRUE)# Display split NMA results on the plotplot(pred, overlay.split=TRUE)# Split NMA results estimated using random treatment effects modelplot(pred, overlay.split=TRUE, method="random")# Add agent labelsplot(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 misleadingpred <- predict(emax, E0 = 0.5, n.doses=3)plot(pred)

Plot histograms of rankings from MBNMA models

Description

Plot histograms of rankings from MBNMA models

Usage

## S3 method for class 'mbnma.rank'plot(x, params = NULL, treat.labs = NULL, ...)

Arguments

x

An object of class"mbnma.rank" generated byrank.mbnma()

params

A character vector of named parameters in the model that vary by either agentor class (depending on the value assigned tolevel). If left asNULL (the default), thenranking will be calculated for all available parameters that vary by agent/class.

treat.labs

A vector of treatment labels in the same order as treatment codes.Easiest to use treatment labels stored bymbnma.network()

...

Arguments to be sent toggplot::geom_bar()

Value

A series of histograms that show rankings for each treatment/agent/prediction, with aseparate panel for each parameter.The object returned is a list containing a separate element for each parameter inparamswhich is an object ofclass(c("gg", "ggplot")).

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Estimate rankings  from an Emax dose-response MBNMAemax <- 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 ED50plot(ranks, params="ed50")# Plot rankings from predictiondoses <- list("eletriptan"=c(0,1,2,3), "rizatriptan"=c(0.5,1,2))pred <- predict(emax, E0 = "rbeta(n, shape1=1, shape2=5)",            exact.doses=doses)rank <- rank(pred)plot(rank)# Trying to plot a parameter that has not been ranked will return an error#### ERROR ##### plot(ranks, params="not.a.parameter")

Run an NMA model

Description

Used for calculating treatment-level NMA results, either when comparing MBNMA models to models thatmake no assumptions regarding dose-response , or to estimate split results foroverlay.split.Results can also be compared between consistency (UME=FALSE) and inconsistency(UME=TRUE) models to test the validity of the consistency assumption at the treatment-level.

Usage

## S3 method for class 'nma'plot(x, bydose = TRUE, scales = "free_x", ...)nma.run(  network,  method = "common",  likelihood = NULL,  link = NULL,  priors = NULL,  sdscale = FALSE,  warn.rhat = TRUE,  n.iter = 20000,  drop.discon = TRUE,  UME = FALSE,  pD = TRUE,  parameters.to.save = NULL,  ...)

Arguments

x

An object ofclass("nma")

bydose

A boolean object indicating whether to plot responses with doseon the x-axis (TRUE) to be able to examine potential dose-response shapes, orto plot a conventional forest plot with all treatments on the same plot (FALSE)

scales

Should scales be fixed ("fixed", the default),free ("free"), or free in one dimension ("free_x","free_y")?

...

Arguments to be sent toggplot2::ggplot()

network

An object of classmbnma.network.

method

Indicates the type of split (treatment-level) NMA to perform whenoverlay.split=TRUE. Cantake either"common" or"random".

likelihood

A string indicating the likelihood to use in the model. Can take either"binomial","normal" or"poisson". If left asNULL the likelihood will be inferred from the data.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

priors

A named list of parameter values (without indices) andreplacement prior distribution values given as stringsusing distributions as specified in JAGS syntax (see Plummer (2017)). Notethat normal distributions in JAGS are specified as

N(\mu, prec)

, where

prec = 1 / {\sigma^2}

.

sdscale

Logical object to indicate whether to write a model that specifies a reference SDfor standardising when modelling using Standardised Mean Differences. Specifyingsdscale=TRUEwill therefore only modify the model if link function is set to SMD (link="smd").

warn.rhat

A boolean object to indicate whether to return a warning if Rhat valuesfor 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 disconnectedstudies from the network.

UME

A boolean object to indicate whether to fit an Unrelated Mean Effects modelthat does not assume consistency and so can be used to test if the consistencyassumption is valid.

pD

logical; ifTRUE (the default) then adds the computation of pD, using the methodof (Plummer 2008). IfFALSE then uses theapproximation ofpD=var(deviance) / 2 (often referred to as pV).

parameters.to.save

A character vector containing names of parametersto monitor in JAGS

Functions

Examples

# Run random effects NMA on the alogliptin datasetalognet <- 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 NMAgoutnet <- mbnma.network(gout)nma <- nma.run(goutnet, method="common", drop.discon=FALSE)# Run an Unrelated Mean Effects (UME) inconsistency model on triptans datasettripnet <- mbnma.network(triptans)ume <- nma.run(tripnet, method="random", UME=TRUE)

Predict responses for different doses of agents in a given population based on MBNMAdose-response models

Description

Used to predict responses for different doses of agents or to predictthe results of a new study. This is calculated by combiningrelative treatment effects with a given reference treatment response(specific to the population of interest).

Usage

## S3 method for class 'mbnma'predict(  object,  n.doses = 30,  exact.doses = NULL,  E0 = 0.2,  synth = "fixed",  lim = "cred",  regress.vals = NULL,  ...)

Arguments

object

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

n.doses

A number indicating the number of doses at which to make predictionswithin each agent. The default is30.

exact.doses

A list of numeric vectors. Each named element in the list corresponds to anagent (either named similarly to agent names given in the data, or namedcorrespondingly to the codes for agents given inmbnma) and each number within the vectorfor that element corresponds to a dose of the agent for which to predict responses.Doses can only take positive values. For models fitted usingdspline() making predictions at only a very smallnumber of doses for each agent may throw an error since it can make the spline difficult to identify.

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 dependingon how it will be used/calculated. The default is0.2 since a default of0 will typically leadto non-sensical predictions unless an identify link function has been used for the MBNMA model inobject.

  • numeric() A single numeric value representing the deterministic response at dose = 0,given on the natural scale - so for binomial data, proportions should be given andfor Poisson data, a rate should be given.

  • character() A single string representing a stochastic distribution for the responseat dose = 0, given on the natural scale - so for binomial data, proportions should be given andfor Poisson data, a rate should be given. This is specified as a random number generator(RNG) given as a string, and can take any RNG distribution for which a function existsin R. For example:"rnorm(n, 7, 0.5)".

  • data.frame() A data frame containing data in the long format (one row per study arm) to be meta-analysedto estimate the dose = 0 (placebo) response. This could be a set of observationalstudies that are specific to the population on which to makepredictions, or it can be a subset of the study arms within the MBNMA datasetthat investigate placebo. Seeref.synth()

synth

A character object that can take the value"fixed" or"random" tospecify the the type of pooling to use for synthesis ofE0 if a data framehas been provided for it. Using"random" ratherthan"fixed" forsynth will result in wider 95\% CrI for predictions.

lim

Specifies calculation of either 95% credible intervals (lim="cred") or 95% prediction intervals (lim="pred").

regress.vals

A named numeric vector of effect modifier values at which results shouldbe predicted. Named elements must match variable names specified inregress.vars withinthe MBNMA model.

...

Arguments to be sent toR2jags::jags() for synthesis of the networkreference treatment effect (usingref.synth())

Details

The range of doses on which to make predictions can be specified in one of two ways:

  1. Usemax.dose andn.doses to specify the maximum dose for each agent and thenumber of doses within that agent for which to predict responses. Doses will be chosenthat are equally spaced from zero to the maximum dose for each agent. This is usefulfor generating plots of predicted responses (using⁠[plot-mbnma.predict]⁠) as it willlead to fitting a smooth dose-response curve (providedn.doses is sufficiently high).

  2. Useexact.doses to specify the exact doses for which to predict responses for eachagent. This may be more useful when ranking different predicted responses using⁠[rank-mbnma.predict]⁠

Value

An S3 object of classmbnma.predict that contains the followingelements:

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMAemax <- 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 probabilitypred <- 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 distributionpred <- 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 datasetref.df <- network$data.ab[network$data.ab$agent==1,]# Synthesis can be fixed/random effectspred <- predict(emax, E0 = ref.df, synth="random")########################################################################## Specifying which doses/agents for which to predict responses ########################################################################### Change the number of predictions for each agentpred <- 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 predictpred <- 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` objectprint(pred)summary(pred)# Plot `mbnma.predict` objectplot(pred)

Print mbnma.network information to the console

Description

Print mbnma.network information to the console

Usage

## S3 method for class 'mbnma.network'print(x, ...)

Arguments

x

An object of classmbnma.network.

...

further arguments passed to or from other methods


Print summary information from an mbnma.predict object

Description

Print summary information from an mbnma.predict object

Usage

## S3 method for class 'mbnma.predict'print(x, ...)

Arguments

x

An object ofclass("mbnma.predict") generated bypredict.mbnma()

...

further arguments passed to or from other methods


Prints summary information about an mbnma.rank object

Description

Prints summary information about an mbnma.rank object

Usage

## S3 method for class 'mbnma.rank'print(x, ...)

Arguments

x

An object of class"mbnma.rank" generated byrank.mbnma()

...

further arguments passed to or from other methods


Prints summary results from an nma.nodesplit object

Description

Prints summary results from an nma.nodesplit object

Usage

## S3 method for class 'nma.nodesplit'print(x, ...)

Arguments

x

An object ofclass("nma.nodesplit")

...

further arguments passed to or from other methods


Prints summary results from a nodesplit object

Description

Prints summary results from a nodesplit object

Usage

## S3 method for class 'nodesplit'print(x, ...)

Arguments

x

An object ofclass("nodesplit")

...

further arguments passed to or from other methods


Print posterior medians (95% credible intervals) for table of relative effects/meandifferences between treatments/classes

Description

Print posterior medians (95% credible intervals) for table of relative effects/meandifferences between treatments/classes

Usage

## S3 method for class 'relative.array'print(x, digits = 2, ...)

Arguments

x

An object of class"relative.array" generated byget.relative()

digits

An integer indicating the number of significant digits to be used.

...

further arguments passed toknitr::kable


Studies of biologics for treatment of moderate-to-severe psoriasis (100% improvement)

Description

A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo(Warren et al. 2019). The outcome is the number of patients experiencing 100% improvement on the PsoriasisArea and Severity Index (PASI) measured at 12 weeks follow-up. The datasetincludes 19 Randomised-Controlled Trials (RCTs), comparing 8 different biologics at different doses with placebo.

Usage

psoriasis100

Format

A data frame in long format (one row per arm and study), with 81 rows and 9 variables:

References

Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019).“Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.”J Am Acad Dermatol,82(5), 1138-1149.


Studies of biologics for treatment of moderate-to-severe psoriasis (>=75% improvement)

Description

A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo(Warren et al. 2019). The outcome is the number of patients experiencing >=75% improvement on the PsoriasisArea and Severity Index (PASI) measured at 12 weeks follow-up. The datasetincludes 28 Randomised-Controlled Trials (RCTs), comparing 9 different biologics at different doses with placebo.

Usage

psoriasis75

Format

A data frame in long format (one row per arm and study), with 81 rows and 9 variables:

References

Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019).“Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.”J Am Acad Dermatol,82(5), 1138-1149.


Studies of biologics for treatment of moderate-to-severe psoriasis (>=90% improvement)

Description

A dataset from a systematic review of Randomised-Controlled Trials (RCTs) comparing biologics at different doses and placebo(Warren et al. 2019). The outcome is the number of patients experiencing >=90% improvement on the PsoriasisArea and Severity Index (PASI) measured at 12 weeks follow-up. The datasetincludes 24 Randomised-Controlled Trials (RCTs), comparing 9 different biologics at different doses with placebo.

Usage

psoriasis90

Format

A data frame in long format (one row per arm and study), with 81 rows and 9 variables:

References

Warren RB, Gooderham M, Burge R, Zhu B, Amato D, Liu KH, Shrom D, Guo J, Brnabic A, Blauvelt A (2019).“Comparison of cumulative clinical benefits of biologics for the treatment of psoriasis over 16 weeks: Results from a network meta-analysis.”J Am Acad Dermatol,82(5), 1138-1149.


Set rank as a method

Description

Set rank as a method

Usage

rank(x, ...)

Arguments

x

An object on which to apply the rank method

...

Arguments to be passed to methods


Rank parameter estimates

Description

Only parameters that vary by agent/class can be ranked.

Usage

## S3 method for class 'mbnma'rank(  x,  params = NULL,  lower_better = TRUE,  level = "agent",  to.rank = NULL,  ...)

Arguments

x

An object on which to apply the rank method

params

A character vector of named parameters in the model that vary by either agentor class (depending on the value assigned tolevel). If left asNULL (the default), thenranking will be calculated for all available parameters that vary by agent/class.

lower_better

Indicates whether negative responses are better (TRUE) or positive responses are better (FALSE)

level

Can be set to"agent" to rank across different agents or"class" to rankacross different classes.

to.rank

A numeric vector containing the codes for the agents/classes you wish to rank.If leftNULL then all agents/classes (depending on the value assigned tolevel) inthe model will be ranked. Included codes must be greater than2 if placebo has been modelled, since placebo cannot be included in the ranking

...

Arguments to be passed to methods

Details

Ranking cannot currently be performed on non-parametric dose-response MBNMA

Value

An object ofclass("mbnma.rank") which is a list containing a summary dataframe, a matrix of rankings for each MCMC iteration, a matrix of probabilitiesthat each agent has a particular rank, and a matrix of cumulative ranking probabilitiesfor each agent, for each parameter that has been ranked.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Rank selected agents from a log-linear dose-response MBNMAloglin <- 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 MBNMAemax <- mbnma.run(network, fun=demax(), method="random")ranks <- rank(emax, params="ed50")summary(ranks)#### Ranking by class ##### Generate some classes for the dataclass.df <- triptansclass.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 worseranks <- rank(emax, level="class", lower_better=FALSE)print(ranks)# Print and generate summary data frame for `mbnma.rank` objectsummary(ranks)print(ranks)# Plot `mbnma.rank` objectplot(ranks)

Rank predicted doses of different agents

Description

Ranks predictions at different doses from best to worst.

Usage

## S3 method for class 'mbnma.predict'rank(x, lower_better = TRUE, rank.doses = NULL, ...)

Arguments

x

An object on which to apply the rank method

lower_better

Indicates whether negative responses are better (TRUE) or positive responses are better (FALSE)

rank.doses

A list of numeric vectors. Each named element corresponds to anagent (as named/coded inpredict), and each number within the vector for that element corresponds to the dosefor that agent. Doses of agents specified inrank.dosesmust be a subset of thosefor which responses have been predicted inpredict. If left asNULL (the default)then all doses of all agents inpredict will be ranked.

...

Arguments to be passed to methods

Details

Ifpredict contains multiple predictions at dose=0, then only the first of thesewill be included, to avoid duplicating rankings.

Value

An object ofclass("mbnma.rank") which is a list containing a summary dataframe, a matrix of rankings for each MCMC iteration, and a matrix of probabilitiesthat each agent has a particular rank, for each parameter that has been ranked.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Rank all predictions from a log-linear dose-response MBNMAloglin <- mbnma.run(network, fun=dloglin())pred <- predict(loglin, E0 = 0.5)rank <- rank(pred)summary(rank)# Rank selected predictions from an Emax dose-response MBNMAemax <- 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` objectsummary(rank)print(rank)# Plot `mbnma.rank` objectplot(rank)

Rank relative effects obtained between specific doses

Description

Ranks"relative.table" objects generated byget.relative().

Usage

## S3 method for class 'relative.array'rank(x, lower_better = TRUE, ...)

Arguments

x

An object on which to apply the rank method

lower_better

Indicates whether negative responses are better (TRUE) or positive responses are better (FALSE)

...

Arguments to be passed to methods

Value

An object ofclass("mbnma.rank") which is a list containing a summary dataframe, a matrix of rankings for each MCMC iteration, and a matrix of probabilitiesthat each agent has a particular rank, for each parameter that has been ranked.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Rank selected predictions from an Emax dose-response MBNMAemax <- 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` objectsummary(rank)print(rank)# Plot `mbnma.rank` objectplot(rank)

Assigns agent or class variables numeric identifiers

Description

Assigns agent or class variables numeric identifiers

Usage

recode.agent(data.ab, level = "agent")

Arguments

data.ab

A data frame of arm-level data in "long" format containing the columns:

  • studyID Study identifiers

  • dose Numeric data indicating the dose (must take positive values)

  • agent Agent identifiers (can be numeric, factor or character)

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data or when modelling Standardised Mean Differences

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

  • class An optional column indicating a particular class code. Agents with the same identifiermust also have the same class code.

  • standsd An optional column of numeric data indicating reference SDs used to standardisetreatment effects when modelling using Standardised Mean Differences (SMD).

level

Can take either"agent" or"class"

Details

Also relabels the agent for any arms in which dose = 0 to "Placebo_0"

Value

A list containing a data frame with recoded agent/class identifiers anda character vector of original agent/class names


Synthesise single arm dose = 0 / placebo studies to estimate E0

Description

Synthesises single arm studies to estimate E0. Used in predicting responses from adose-response MBNMA.

Usage

ref.synth(  data.ab,  mbnma,  synth = "fixed",  n.iter = mbnma$BUGSoutput$n.iter,  n.burnin = mbnma$BUGSoutput$n.burnin,  n.thin = mbnma$BUGSoutput$n.thin,  n.chains = mbnma$BUGSoutput$n.chains,  ...)

Arguments

data.ab

A data frame of arm-level data in "long" format containing thecolumns:

  • studyID Study identifiers

  • y Numeric data indicating the aggregate response for a continuous outcome. Required forcontinuous data.

  • se Numeric data indicating the standard error for a given observation. Required forcontinuous data.

  • r Numeric data indicating the number of responders within a study arm. Required forbinomial or poisson data.

  • n Numeric data indicating the total number of participants within a study arm. Required forbinomial data

  • E Numeric data indicating the total exposure time for participants within a study arm. Requiredfor poisson data.

mbnma

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

synth

A character object that can take the value"fixed" or"random" tospecify the the type of pooling to use for synthesis ofE0 if a data framehas been provided for it. Using"random" ratherthan"fixed" forsynth will result in wider 95\% CrI for predictions.

n.iter

number of total iterations per chain (including burn in;default: 2000)

n.burnin

length of burn in, i.e. number of iterations todiscard at the beginning. Default isn.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. Setn.thin > 1 to save memory and computation time ifn.iter is large. Default ismax(1, floor(n.chains * (n.iter-n.burnin) / 1000)) which will only thin if there are atleast 2000 simulations.

n.chains

number of Markov chains (default: 3)

...

Arguments to be sent toR2jags::jags() for synthesis of the networkreference treatment effect (usingref.synth())

Details

data.ab can be a collection of studies that closely resemble thepopulation of interest intended for the prediction, which could bedifferent to those used to estimate the MBNMA model, and could includesingle arms of RCTs or observational studies. If other data is notavailable, the data used to estimate the MBNMA model can be used byselecting only the studies and arms that investigate dose = 0 (placebo).

Defaults forn.iter,n.burnin,n.thin andn.chains are those used to estimatembnma.

Value

A list of named elements corresponding to E0 and the between-study standard deviation forE0 ifsynth="random". Each element contains the full MCMC results from the synthesis.

Examples

# Using the triptans datanetwork <- mbnma.network(triptans)# Run an Emax dose-response MBNMAemax <- mbnma.run(network, fun=demax(), method="random")# Data frame for synthesis can be taken from placebo armsref.df <- triptans[triptans$agent=="placebo",]# Meta-analyse placebo studies using fixed treatment effectsE0 <- ref.synth(ref.df, emax, synth="fixed")names(E0)# Meta-analyse placebo studies using random treatment effectsE0 <- ref.synth(ref.df, emax, synth="random")names(E0)

Description

Rescale data depending on the link function provided

Usage

rescale.link(x, direction = "link", link = "logit")

Arguments

x

A numeric vector of data to be rescaled

direction

Can take either"link" to convert data to a particular scaleas defined by thelink function, or"natural" to return it to the natural scale.

link

A string indicating the link function to use in the model. Can take any link functiondefined within JAGS (e.g."logit","log","probit","cloglog"), be assigned the value"identity" foran identity link function, or be assigned the value"smd" for modelling Standardised Mean Differences using anidentity link function. If left asNULL the link function will be automatically assigned basedon the likelihood.

Value

A rescaled numeric vector


Studies of wound closure methods to reduce Surgical Site Infections (SSI)

Description

A dataset from an ongoing systematic review examining the efficacy of different wound closure methods to reduce surgicalsite infections (SSI). The outcome is binary and represents the number of patients who experienced a SSI. The datasetincludes 129 RCTs comparing 16 different interventions in 6 classes. This dataset is primarily used to illustratehowMBNMAdose can be used to perform different types of network meta-analysis without dose-response information.

Usage

ssi_closure

Format

A data frame in long format (one row per arm and study), with 281 rows and 6 variables:


Studies of Selective Serotonin Reuptake Inhibitors (SSRIs) for major depression

Description

A dataset from a systematic review examining the efficacy of different doses of SSRI antidepressant drugs and placebo(Furukawa et al. 2019). The response to treatment is defined as a 50% reduction in depressive symptoms after 8 weeks(4-12 week range) follow-up. The dataset includes 60 RCTs comparing 5 different SSRIs with placebo.

Usage

ssri

Format

A data frame in long format (one row per arm and study), with 145 rows and 8 variables:

References

Furukawa TA, Cipriani A, Cowen PJ, Leucht S, Egger M, Salanti G (2019).“Optimal dose of selective serotonin reuptake inhibitors, venlafaxine, and mirtazapine in major depression: a systematic review and dose-response meta-analysis.”Lancet Psychiatry,6, 601-609.


Print summary of MBNMA results to the console

Description

Print summary of MBNMA results to the console

Usage

## S3 method for class 'mbnma'summary(object, digits = 4, ...)

Arguments

object

An S3 object of class"mbnma" generated by runninga dose-response MBNMA model

digits

The maximum number of digits for numeric columns

...

additional arguments affecting the summary produced


Print summary mbnma.network information to the console

Description

Print summary mbnma.network information to the console

Usage

## S3 method for class 'mbnma.network'summary(object, ...)

Arguments

object

An object of classmbnma.network.

...

further arguments passed to or from other methods


Produces a summary data frame from an mbnma.predict object

Description

Produces a summary data frame from an mbnma.predict object

Usage

## S3 method for class 'mbnma.predict'summary(object, ...)

Arguments

object

An object of⁠class("mbnma.predict)"⁠ generated bypredict("mbnma")

...

additional arguments affecting the summary produced.

Value

A data frame containing posterior summary statistics from predicted responsesfrom a dose-response MBNMA model


Generates summary data frames for an mbnma.rank object

Description

Generates summary data frames for an mbnma.rank object

Usage

## S3 method for class 'mbnma.rank'summary(object, ...)

Arguments

object

An object ofclass("mbnma.rank") generated byrank.mbnma()

...

additional arguments affecting the summary produced

Value

A list in which each element represents a parameter that has been rankedinmbnma.rank and contains a data frame of summary ranking results.


Generates a summary data frame for nma.nodesplit objects

Description

Generates a summary data frame for nma.nodesplit objects

Usage

## S3 method for class 'nma.nodesplit'summary(object, ...)

Arguments

object

An object ofclass("nma.nodesplit")

...

further arguments passed to or from other methods


Generates a summary data frame for nodesplit objects

Description

Generates a summary data frame for nodesplit objects

Usage

## S3 method for class 'nodesplit'summary(object, ...)

Arguments

object

An object ofclass("nodesplit")

...

further arguments passed to or from other methods


Studies of triptans for headache pain relief

Description

A dataset from a systematic review of interventions for pain relief in migraine (Thorlund et al. 2014).The outcome is binary, and represents (as aggregate data) the proportion of participants who wereheadache-free at 2 hours. Data are from patients who had had at least one migraine attack, who werenot lost to follow-up, and who did not violate the trial protocol. The dataset includes 70 Randomised-ControlledTrials (RCTs), comparing 7 triptans with placebo. Doses are standardised as relative to a "common" dose,and in total there are 23 different treatments (combination of dose and agent).

Usage

triptans

Format

A data frame in long format (one row per arm and study), with with 181 rows and 6 variables:

Source

There are no references for Rd macro⁠\insertAllCites⁠ on this help page.


[8]ページ先頭

©2009-2025 Movatter.jp