crossnma.model {crossnma}R Documentation

Create JAGS model and data to perform cross network meta analysis or meta-regression

Description

This function creates a JAGS model and the needed data for cross-design and cross-format network meta-analysis or meta-regression for different types of outcome

Usage

crossnma.model(
  trt,
  study,
  outcome,
  n,
  design,
  se,
  cov1 = NULL,
  cov2 = NULL,
  cov3 = NULL,
  bias = NULL,
  unfav = NULL,
  bias.covariate = NULL,
  bias.group = NULL,
  prt.data = NULL,
  std.data = NULL,
  sm,
  reference = NULL,
  trt.effect = "random",
  level.ma = gs("level.ma"),
  sucra = FALSE,
  small.values = NULL,
  cov1.value = NULL,
  cov2.value = NULL,
  cov3.value = NULL,
  cov1.ref = NULL,
  cov2.ref = NULL,
  cov3.ref = NULL,
  reg0.effect = "independent",
  regb.effect = "random",
  regw.effect = "random",
  split.regcoef = TRUE,
  method.bias = NULL,
  bias.type = NULL,
  bias.effect = "common",
  down.wgt = NULL,
  prior.tau.trt = NULL,
  prior.tau.reg0 = NULL,
  prior.tau.regb = NULL,
  prior.tau.regw = NULL,
  prior.tau.bias = NULL,
  prior.pi.high.rct = NULL,
  prior.pi.low.rct = NULL,
  prior.pi.high.nrs = NULL,
  prior.pi.low.nrs = NULL,
  run.nrs.var.infl = 1,
  run.nrs.mean.shift = 0,
  run.nrs.trt.effect = "common",
  run.nrs.n.adapt = 1000,
  run.nrs.n.iter = 10000,
  run.nrs.n.burnin = 4000,
  run.nrs.thin = 1,
  run.nrs.n.chains = 2,
  backtransf = gs("backtransf"),
  run.nrs.n.thin = NULL
)

Arguments

trt

Treatment variable in prt.data and std.data.

study

Study variable in prt.data and std.data.

outcome

Outcome variable in prt.data and std.data.

n

Number of participants in std.data.

design

Design variable in prt.data and std.data.

se

Standard error variable in std.data (required only for continuous outcome when sm = "MD" or "SMD").

cov1

Optional first covariate in prt.data and std.data to conduct network meta-regression (see Details).

cov2

Optional second covariate in prt.data and std.data to conduct network meta-regression (see Details).

cov3

Optional third covariate in prt.data and std.data to conduct network meta-regression (see Details).

bias

Optional variable with information on risk of bias in prt.data and std.data. Possible values for this variable are "low", "high" or "unclear" (can be abbreviated). These values must be identical for all participants from the same study. Either this variable or bias.covariate variable should be provided when method.bias = "adjust1" or "adjust2".

unfav

An optional variable in prt.data and std.data indicating the unfavored treatment in each study (should be provided when method.bias = "adjust1" or "adjust2"). The entries of this variable are either 0 (unfavored treatment) or 1 (favorable treatment or treatments). Each study should include only one 0 entry. The values need to be repeated for participants who take the same treatment.

bias.covariate

An optional variable in prt.data and std.data indicate the covariate used to estimate the probability of bias. Either this variable or bias variable should be provided when method.bias = "adjust1" or "adjust2".

bias.group

An optional variable in prt.data and std.data that indicates the bias effect in each study (can be provided when method.bias = "adjust1" or "adjust2"). The entries of these variables should be either 1 (study has inactive treatment and its estimate should be adjusted for bias effect), 2 (study has only active treatments and its estimate should be adjusted for bias effect (different from inactive bias effect) or 0 (study does not need any bias adjustment). The values need to be repeated for the participants assigned to the same treatment. Default is 1.

prt.data

An object of class data.frame containing the individual participant dataset. Each row contains the data of a single participant. The dataset needs to have the following columns: treatment, study identification, outcome (event and non-event), design. Additional columns might be required for certain analyses.

std.data

An object of class data.frame containing the study-level dataset. Each row represents the information of study arm. The dataset needs to have the following columns: treatment, study identification, outcome (number of events), sample size and design. Additional columns might be required for certain analyses.

sm

A character indicating the underlying summary measure. Options are: Odds Ratio "OR" (default), Risk Ratio "RR", Mean Difference "MD" or Standardised Mean Difference "SMD".

reference

A character indicating the name of the reference treatment. When the reference is not specified, the first alphabetic treatment will be used as a reference in the analysis.

trt.effect

A character defining the model for the study-specific treatment effects. Options are "random" (default) or "common".

level.ma

The level used to calculate credible intervals for network estimates.

sucra

Logical. If TRUE SUCRA (Surface Under the Cumulative Ranking) values will be calculated within JAGS.

small.values

A character string specifying whether small treatment effects indicate a beneficial ("desirable") or harmful ("undesirable") effect, can be abbreviated. This argument is required when sucra is TRUE.

cov1.value

The participant covariate value of cov1 for which to report the results. Must be specified for network meta-regression, sucra is TRUE and when individual participant dataset is used in the analysis. For dichotomous covariates, a character of the level (used in the data) should be indicated.

cov2.value

The participant covariate value of cov2 for which to report the results. Must be specified for network meta-regression, sucra is TRUE and when individual participant dataset is used in the analysis. For dichotomous covariates, a character of the level (used in the data) should be indicated.

cov3.value

The participant covariate value of cov3 for which to report the results. Must be specified for network meta-regression, sucra is TRUE and when individual participant dataset is used in the analysis. For dichotomous covariates, a character of the level (used in the data) should be indicated.

cov1.ref

An optional value to center the first covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies.

cov2.ref

An optional value to center the second covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies.

cov3.ref

An optional value to center the third covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies.

reg0.effect

An optional character (can by provided when at least cov1 is not NULL) indicating the relationship across studies for the prognostic effects expressed by the regression coefficient, (\beta_0), in a study j. Options are "independent" or "random". We recommend using "independent" (default).

regb.effect

An optional character (can by provided when at least cov1 is not NULL) indicating the relationship across treatments for the between-study regression coefficient (\beta^B). This parameter quantifies the treatment-mean covariate interaction. Options are "independent", "random" or "common". Default is "random".

regw.effect

An optional character (can by provided when at least cov1 is not NULL) indicating the relationship across treatments for the within-study regression coefficient (\beta^W). This parameter quantifies the treatment-covariate interaction effect at the individual level. Options are "independent", "random" and "common". Default is "random".

split.regcoef

A logical value (needed when at least cov1 is not NULL). If TRUE (default) the within- and between-study coefficients will be splitted in the analysis of prt.data. When the split.regcoef = FALSE, only a single regression coefficient will be estimated to represent both the between-studies and within-studies covariate effects. In this case, both arguments regb.effect and regw.effect need to be given the same option to model the single regression effect.

method.bias

A character for defining the method to combine randomized clinical trials (RCT) and non-randomized studies (NRS). Options are "naive" for naive or unadjusted synthesize, "prior" for using NRS evidence to construct priors for the relative treatment effects in RCTs analysis, or "adjust1" and "adjust2" to allow a bias adjustment. When only one design is available (either rct or nrs), this argument needs also to be specified to indicate whether unadjusted (naive) or bias-adjusted analysis (adjust1 or adjust2) should be applied.

bias.type

An optional character defining the relationship between the bias effect and the treatment effect (required when method.bias = "adjust1"). Three options are possible: "add" to add the additive bias effect, "mult" for multiplicative bias effect and "both" includes both an additive and a multiplicative terms.

bias.effect

An optional character indicating the relationship for the bias coefficients across studies. Options are "random" or "common" (default). It can be provided when method.bias = "adjust1" or "adjust2".

down.wgt

An optional numeric indicating the percent to which studies at high risk of bias will be downweighted on average. The value ranges between 0 and 1. It can be provided when method.bias = "adjust1" or "adjust2".

prior.tau.trt

Optional string to specify the prior for the between-study heterogeneity in treatment effects in JAGS model (when trt.effect="random"). The default prior is constructed from the data (see Details).

prior.tau.reg0

Optional string to specify the prior for the between-study heterogeneity in prognostic effects in JAGS model (when reg0.effect="random"). The default prior is constructed from the data (see Details).

prior.tau.regb

Optional string to specify the prior for the between-study heterogeneity in between-study covariate effects in JAGS model (when regb.effect="random"). The default prior is constructed from the data (see Details).

prior.tau.regw

Optional string to specify the prior for the between-study heterogeneity in within-study covariate effects in JAGS model (when regw.effect="random"). The default prior is constructed from the data (see Details).

prior.tau.bias

Optional string to specify the prior for the between-study heterogeneity in bias effects in JAGS model (when bias.effect="random").

prior.pi.high.rct

Optional string to provide the prior for the bias probability of randomised clinical trials (RCT) with high risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(10,1)".

prior.pi.low.rct

Optional string to provide the prior for the bias probability of randomised clinical trials (RCT) with low risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(1,10)".

prior.pi.high.nrs

Optional string to provide the prior for the bias probability of non-randomised studies (NRS) with high risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(30,1)".

prior.pi.low.nrs

Optional string to provide the prior for the bias probability of non-randomised studies (NRS) with low risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(1,30)".

run.nrs.var.infl

Optional numeric controls the common inflation of the variance of NRS estimates (w) and its values range between 0 (NRS does not contribute at all and the prior is vague) and 1 (the NRS evidence is used at face value, default approach). This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.mean.shift

Optional numeric controls the bias shift (\zeta) to be added / subtracted from the estimated mean treatment effects (on the log-scale when sm = "OR" or "RR") from NRS network (0 is the default). This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.trt.effect

Optional character indicates how to combine treatment effects across NRS studies. Options are "random" or "common" (default). This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.n.adapt

DESCRIBE ARGUMENT.

run.nrs.n.iter

Optional numeric specifies the number of iterations to run MCMC chains for NRS network. Default is 10000. This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.n.burnin

Optional numeric specifies the number of burn-in to run MCMC chains for NRS network. Default is 4000. This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.thin

Optional numeric specifying thinning to run MCMC chains for NRS network. Default is 1. This argument can be provided when the NRS used as a prior (method.bias = "prior").

run.nrs.n.chains

Optional numeric specifies the number of chains to run MCMC chains for NRS network. Default is 2. This argument can be provided when the NRS used as a prior (method.bias = "prior").

backtransf

A logical indicating whether results should be back transformed in printouts. If backtransf = TRUE, results for sm = "OR" are presented as odds ratios rather than log odds ratios, for example.

run.nrs.n.thin

Deprecated argument (replaced by run.nrs.thin).

Details

This function creates a JAGS model and the needed data. The JAGS code is created from the internal function crossnma.code.

Covariates provided in arguments cov1, cov2 and cov3 can be either numeric or dichotomous (should be provided as factor or character) variables. By default, no covariate adjustment is applied (network meta-analysis).

The default prior for the between-study heterogeneity parameters (prior.tau.trt, prior.tau.reg0, prior.tau.regb, prior.tau.regw and prior.tau.bias) is a uniform distribution over the range 0 to ML, where ML is the largest maximum likelihood estimates of all relative treatment effects in all studies.

Value

An object of class crossnma.model containing information on the JAGS model, which is a list containing the following components:

model

A long character string containing JAGS code that will be run in jags.parallel.

data

The data to be used to run JAGS model.

trt.key

A table of the treatments and its mapped integer number (as used in JAGS model).

study.key

A table of the studies and its mapped integer number (as used in JAGS model).

trt.effect

A character defining the model for the study-specific treatment effects.

method.bias

A character for defining the method to analyse combine randomized clinical trials (RCT) or \/ and non-randomized studies (NRS).

covariate

A vector of the the names of the covariates (cov1, cov2 and cov3) in prt.data and std.data used in network meta-regression.

cov.ref

A vector of values of cov1.ref, cov2.ref, cov3.ref to center continuous covariates. Dichotomous covariates take NA.

dich.cov.labels

A matrix with the levels of each dichotomous covariate and the corresponding assigned 0 / 1 values.

split.regcoef

A logical value. If FALSE the within- and between-study regression coefficients will be considered equal.

regb.effect

A character indicating the model for the between-study regression coefficients across studies.

regw.effect

A character indicating the model for the within-study regression coefficients across studies.

bias.effect

A character indicating the model for the bias coefficients across studies.

bias.type

A character indicating the effect of bias on the treatment effect; additive ("add") or multiplicative ("mult") or both ("both").

all.data.ad

A data.frame object with the prt.data (after it is aggregated) and std.data in a single dataset.

call

Function call.

version

Version of R package crossnma used to create object.

Author(s)

Tasnim Hamza tasnim.hamza@ispm.unibe.ch, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de

See Also

crossnma, jags.parallel

Examples

## Not run: 
# We conduct a network meta-analysis assuming a random-effects
# model.
# The data comes from randomized-controlled trials and
# non-randomized studies (combined naively)
head(ipddata) # participant-level data
stddata # study-level data

# Create a JAGS model
mod <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  reference = "A", trt.effect = "random", method.bias = "naive")

# Print call of JAGS model
mod

# Print JAGS code
summary(mod)

# Fit JAGS model
set.seed(1909)
fit <- crossnma(mod)

# Display the output
summary(fit)
plot(fit)

## End(Not run)


[Package crossnma version 1.2.0 Index]