Learn R Programming

⚠️There's a newer version (0.2.6) of this package.Take me there.

MBNMAtime

The goal of MBNMAtime is to provide a collection of useful commands that allow users to run time-course Model-Based Network Meta-Analysis (MBNMA). This allows meta-analysis of studies with multiple follow-up measurements that can account for time-course for a single or multiple treatment comparisons.

Including all available follow-up measurements within a study makes use of all the available evidence in a way that maintains connectivity between treatments, and it does so in a way that explains time-course, thus explaining heterogeneity and inconsistency that may be present in a standard Network Meta-Analysis (NMA). All models and analyses are implemented in a Bayesian framework, following an extension of the standard NMA methodology presented by Lu and Ades (2004) and are run in JAGS (JAGS Computer Program 2017). For full details of time-course MBNMA methodology see Pedder et al. (2019).

Installation

Currently the package is available on CRAN and can can be installed using:

install.packages("MBNMAtime")

The development version can be installed directly from GitHub using the devtools R package:

# First install devtools
install.packages("devtools")

# Then install MBNMAtime directly from GitHub
devtools::install_github("hugaped/MBNMAtime")

Workflow

Functions within MBNMAtime follow a clear pattern of use:

  1. Load your data into the correct format using mb.network()
  2. Specify a suitable time-course function and analyse your data using mb.run()
  3. Test for consistency using functions like mb.nodesplit()
  4. Examine model results using forest plots and treatment rankings
  5. Use your model to predict responses or estimate treatment effects at specific time-points using predict()

At each of these stages there are a number of informative plots that can be generated to help make sense of your data and the models that you are fitting. Exported functions in the package are connected like so:

MBNMAtime package structure: Light green nodes represent classes and the generic functions that can be applied to them. Dashed boxes indicate functions that can be applied to objects of specific classes

References

JAGS Computer Program. 2017. https://mcmc-jags.sourceforge.io/.

Lu, G., and A. E. Ades. 2004. “Combination of Direct and Indirect Evidence in Mixed Treatment Comparisons.” Journal Article. Stat Med 23 (20): 3105–24. https://doi.org/10.1002/sim.1875.

Pedder, H., S. Dias, M. Bennetts, M. Boucher, and N. J. Welton. 2019. “Modelling Time-Course Relationships with Multiple Treatments: Model-Based Network Meta-Analysis for Continuous Summary Outcomes.” Journal Article. Res Synth Methods 10 (2): 267–86.

Copy Link

Version

Install

install.packages('MBNMAtime')

Monthly Downloads

308

Version

0.2.4

License

GPL-3

Maintainer

Hugo Pedder

Last Published

October 14th, 2023

Functions in MBNMAtime (0.2.4)

alog_pcfb

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

Plot relative effects from NMAs performed at multiple time-bins
devplot

Plot deviance contributions from an MBNMA model
get.earliest.time

Create a dataset with the earliest time point only
get.latest.time

Create a dataset with the latest time point only
gen.parameters.to.save

Automatically generate parameters to save for a time-course MBNMA model
get.prior

Get current priors from JAGS model code
get.model.vals

Get MBNMA model values
get.relative

Calculates relative effects/mean differences at a particular time-point
diabetes

Studies comparing treatments for type 2 diabetes
genmaxcols

Get large vector of distinct colours using Rcolorbrewer
getjagsdata

Prepares data for JAGS
get.closest.time

Create a dataset with a single time point from each study closest to specified time
genspline

Generates spline basis matrices for fitting to time-course function
plot.nodesplit

Perform node-splitting on a MBNMA time-course network
hyalarthritis

Studies comparing hyaluronan (HA)–based viscosupplements for osteoarthritis
mb.comparisons

Identify unique comparisons within a network (identical to MBNMAdose)
inconsistency.loops

Identify comparisons in loops that fulfil criteria for node-splitting
getnmadata

Prepares NMA data for JAGS
goutSUA_CFBcomb

Studies of combined treatments for reducing serum uric acid in patients with gout
mb.make.contrast

Convert arm-based MBNMA data to contrast data
plot.mb.network

Create an mb.network object
goutSUA_CFB

Studies of treatments for reducing serum uric acid in patients with gout
mb.nodesplit.comparisons

Identify comparisons in time-course MBNMA datasets that fulfil criteria for node-splitting
nma.run

Run an NMA model
obesityBW_CFB

Studies of treatments for reducing body weight in patients with obesity
mb.validate.data

Validates that a dataset fulfils requirements for MBNMA
mb.run

Run MBNMA time-course models
plot.mb.predict

Plots predicted responses from a time-course MBNMA model
mb.update

Update MBNMA to obtain deviance contributions or fitted values
mb.write

Write MBNMA time-course models JAGS code
%>%

Pipe operator
osteopain

Studies of pain relief medications for osteoarthritis
pDcalc

Calculate plugin pD from a JAGS model with univariate likelihood for studies with repeated measurements
print.mb.predict

Print summary information from an mb.predict object
rank

Set rank as a method
print.nodesplit

Prints basic results from a node-split to the console
radian.rescale

Calculate position of label with respect to vertex location within a circle
print.mb.rank

Prints a summary of rankings for each parameter
print.relative.array

Print posterior medians (95% credible intervals) for table of relative effects/mean differences between treatments/classes
plot.mb.rank

Plot histograms of rankings from MBNMA models
plot.mbnma

Forest plot for results from time-course MBNMA models
predict.mbnma

Predict effects over time in a given population based on MBNMA time-course models
print.mb.network

Print mb.network information to the console
remove.loops

Removes any loops from MBNMA model JAGS code that do not contain any expressions
rankauc

Calculates ranking probabilities for AUC from a time-course MBNMA
ref.synth

Synthesise single arm studies with repeated observations of the same treatment over time
summary.mb.predict

Prints summary of mb.predict object
ref.comparisons

Identify unique comparisons relative to study reference treatment within a network
summary.mb.network

Print summary mb.network information to the console
replace.prior

Replace original priors in an MBNMA model with new priors
rank.mbnma

Rank parameters from a time-course MBNMA
ref.validate

Checks the validity of ref.resp if given as data frame
rank.mb.predict

Rank predictions at a specific time point
titp

Integrated Two-Component Prediction (ITP) function
tloglin

Log-linear (exponential) time-course function
timeplot

Plot raw responses over time by treatment or class
summary.nodesplit

Takes node-split results and produces summary data frame
tspline

Spline time-course functions
tpoly

Polynomial time-course function
summary.mbnma

Print summary MBNMA results to the console
tfpoly

Fractional polynomial time-course function
temax

Emax time-course function
tuser

User-defined time-course function
write.likelihood

Adds sections of JAGS code for an MBNMA model that correspond to the likelihood
write.timecourse

Adds sections of JAGS code for an MBNMA model that correspond to alpha parameters
write.cor

Adds correlation between time-course relative effects
write.beta

Adds sections of JAGS code for an MBNMA model that correspond to beta parameters
write.model

Write the basic JAGS model code for MBNMA to which other lines of model code can be added
write.check

Checks validity of arguments for mb.write
write.ref.synth

Write MBNMA time-course models JAGS code for synthesis of studies investigating reference treatment
cumrank

Plot cumulative ranking curves from MBNMA models
add_index

Add follow-up time and arm indices to a dataset
default.priors

Sets default priors for JAGS model code
fitplot

Plot fitted values from MBNMA model
MBNMAtime-package

MBNMAtime for Model-Based Network Meta-Analysis of longitudinal (time-course) data
copd

Studies comparing Tiotropium, Aclidinium and Placebo for maintenance treatment of moderate to severe chronic obstructive pulmonary disease