nma.model.contrast: Create Bugs Model for contrast-Level data

View source: R/nma.model.contrast.R

nma.model.contrastR Documentation

Create Bugs Model for contrast-Level data

Description

Creates BUGS code which can be ran through nma.run().

Usage

nma.model.contrast(
  data_contrast = NULL,
  differences,
  se.diffs,
  var.arm1 = NULL,
  reference,
  type = "consistency",
  effects,
  scale,
  prior.mu = "DEFAULT",
  prior.d = "DEFAULT",
  prior.sigma = "DEFAULT"
)

Arguments

data_contrast

A BUGSnetData object containing the data from contrast-based trials produced by data.prep()

differences

A string indicating the name of the differences for contrast-based studies

se.diffs

A string indicating the variable name of the standard errors of the differences.

var.arm1

A string (only required for networks with multi-arm trials) indicating the variable name of the variance of the treatment in arm 1 of each study

reference

A string for the treatment that will be seen as the 'referent' comparator and labeled as treatment 1 in the BUGS code. This is often a placebo or control drug of some kind.

type

If type="inconsistency", an inconsistency model will be built. By default, type="consistency" and a consistency model is built. will be built.

effects

A string indicating the type of treatment effect relative to baseline. Options are "fixed" or "random".

scale

A string indicating the scale of the data, such as "Mean Difference" or "Log-Odds Ratio".

prior.mu

A string of BUGS code that defines priors on the baseline treatment effects. By default, independent normal priors are used with mean 0 and standard deviation 15u, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet.

prior.d

A string of BUGS code that defines define priors on relative treatment effects. By default, independent normal priors are used with mean 0 and standard deviation 15u, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet.

prior.sigma

A string of BUGS code that defines the prior on the variance of relative treatment effects. By default, a uniform distribution with range 0 to u is used, where u is the largest maximum likelihood estimator in single trials \insertCite@see @gemtcBUGSnet.

Value

nma.model returns an object of class BUGSnetModel which is a list containing the following components:

bugs - A long character string containing BUGS code that will be run in jags.

data - The data used in the BUGS code.

scale - The scale of the outcome, based on the chosen family and link function examples are "Risk Ratio" (relative risk), "Odds Ratio", "Mean Difference", "Hazard Ratio"

trt.key - Treatments mapped to integer numbers, used to run BUGS code.

...

References

\insertRef

gemtcBUGSnet

\insertRef

TSD3BUGSnet

See Also

data.prep, nma.run

Examples

data(diabetes.sim)

diabetes.slr <- data.prep(
  arm.data = diabetes.sim, 
  varname.t = "Treatment", 
  varname.s = "Study"
)

#Random effects, consistency model.
#Binomial family, cloglog link. This implies that the scale will be the Hazard Ratio.
diabetes.re.c <- nma.model(
  data = diabetes.slr,
  outcome = "diabetes", 
  N = "n",
  reference = "Placebo",
  family = "binomial",
  link = "cloglog",
  effects = "random",
  type = "consistency",
  time = "followup"
)
       
#Fixed effects, consistency model.
#Binomial family, cloglog link. This implies that the scale will be the Hazard Ratio.
diabetes.fe.c <- nma.model(
  data = diabetes.slr,
  outcome = "diabetes", 
  N = "n",
  reference = "Placebo",
  family = "binomial",
  link = "cloglog",
  effects = "fixed",
  type = "consistency",
  time = "followup"
)

audrey-b/BUGSnet documentation built on Feb. 2, 2025, 5:10 p.m.