crossnma: Cross-Design & Cross-Format Network Meta-Analysis and Regression

Introduction

In network meta-analysis we synthesize all relevant available evidence about health outcomes from competing treatments. That evidence might come from different study designs and in different formats: from non-randomized studies (NRS) or randomized controlled trials (RCT) as individual participant data (IPD) or as aggregate data (AD). We set up the package crossnma to synthesize all available evidence for a binary outcome with the odds ratio as effect measure.

This document demonstrates how to use crossnma to synthesize cross-design evidence and cross-format data via Bayesian network meta-analysis and meta-regression (NMA and NMR). All models are implemented in JAGS (Plummer 2003).

We describe the workflow within the package using a worked example from a network meta-analysis of studies for treatments in relapsing remitting multiple sclerosis (RRMS). The primary outcome is the occurrence of relapses in two years (binary outcome). In the analysis, the relative effect will be the odds ratio (OR). The aim is to compare the efficacy of four treatments using the data from 6 different studies in different formats and different designs.

The synthesis models

We first introduce the model that synthesizes studies with individual-level (IPD) or/and aggregate data (AD) ignoring their design (unadjusted synthesis). Then, we present three possible models that account for the different study designs. In the table below we set the notation that will be used in the description of the four synthesis models.

Notation Description Argument in crossnma.model()
i = 1, ..., npj participant id
j = 1, ..., ns study id study
k = 1, ..., K treatment index trt
nsIPD, nsAD, nsRCT, nsNRS the number of studies. The index refers to the design or format of the study
yijk binary outcome (0/1) outcome
pijk probability of the event to occur
rjk the number of events per arm outcome
njk the sample size per arm n
b the study-specific reference *
ujb The treatment effect of the study-specific reference b when xijk = j = 0
δjbk log(OR) of treatment k relative to b
xijk the covariate cov1, cov2, cov3
j the mean covariate for study j
dAk the basic parameters. Here, dAA = 0 when A is set as the reference in the network use reference to assign the reference treatment
zj study characteristics to estimate the bias probability πj bias.covariate
w common inflation factor of variance for the NRS estimates the element var.infl in run.nrs
ζ common mean shift of the NRS estimates the element mean.shift in run.nrs

*The study-specific reference b is assigned automatically to be the network reference for studies that have the network reference treatment. If not, it is assigned to the first alphabetically ordered treatment on the study.

Unadjusted network meta-regression (NMR)

We synthesize the evidence from RCT and NRS without acknowledging the differences between them. We combine the IPD data from RCT and NRS in one model and we do the same in another model with the AD information. Then, we combine the estimates from both parts as described in Section 2.5.

NMR model for IPD studies

yijk ∼ Bernoulli(pijk)

NMR model for AD studies

rjk ∼ Binomial(p.jk, njk)

Using non-randomized studies (NRS) to construct priors for the treatment effects

First, the (network) meta-regression with only NRS data estimates the relative treatment effects with posterior distribution of mean AkNRS and variance VAkNRS (use run.nrs in crossnma.model() to control this process). The posteriors of NRS results are then used as priors for the corresponding basic parameters in the RCT model, dAk ∼ 𝒩(AkNRS, VAkNRS). We can adjust for potential biases associated with NRS by either shifting the mean of the prior distribution with a bias term ζ or by dividing the prior variance with a common inflation factor w, 0 < w < 1 controls NRS contribution. The assigned priors become dAk ∼ 𝒩(AkNRS + ζ, VAkNRS/w).

Bias-adjusted model 1

We incorporate judgments about study risk of bias (RoB) in bias-adjusted model 1 and model 2. Each judgment about the risk of bias in a study is summarized by the index Rj which takes binary values 0 (no bias) or 1 (bias). In bias-adjusted model 1, we extend the method introduced by Dias et al. (2010) by adding a treatment-specific bias term γ2, jbkRj to the relative treatment effect on both the AD and IPD parts of the model. A multiplicative model can also be employed, where treatment effects are multiplied by γ1, jbkRj. We can add either multiplicative bias effects, additive bias effects, or both (in this case, δjbk should be dropped from the additive part). The models in previous section are extended to adjust for bias as follows.

NMR model for IPD studies

NMR model for AD studies

The bias indicator Rj follows the following distribution

Rj ∼ Bernoulli(πj) The bias probabilities πj are study-specific and can be estimated in two different ways. They are either given informative beta priors (Beta(a1, a2)) that are set according to the risk of bias for each study. πj ∼ Beta(a1, a2)

The hyperparameters a1 and a2 should be chosen in a way that reflects the risk of bias for each study. The degree of skewness in beta distribution can be controlled by the ratio a1/a2 . When a1/a2 equals 1 (or a1 = a2), there is no skewness in the beta distribution (the distribution is reduced to a uniform distribution), which is appropriate for studies with unclear risk of bias. When the ratio a1/a2 is closer to 1, the more the mean of probability of bias (expected value of πj = a1/(a1 + a2)) gets closer to 1 and the study acquires ‘major’ bias adjustment. The default beta priors are as follows: high bias RCT prior.pi.high.rct='dbeta(10, 1)', low bias RCT prior.pi.low.rct = 'dbeta(1, 10)', high bias NRS prior.pi.high.nrs = 'dbeta(30, 1)' and low bias NRS prior.pi.low.nrs = 'dbeta(1, 30)'. Alternatively, we can use the study characteristics zj to estimate πj through a logistic transformation (internally coded).

We combine the multiplicative and the additive treatment-specific bias effects across studies by assuming they are exchangeable γ1, jbk ∼ 𝒩(g1, bk, τ1, γ2),γ2, jbk ∼ 𝒩(g2, bk, τ2, γ2)) or common γ1, jbk = g1, bk and γ2, jbk = g2, bk. Dias et al. (2010) proposed to model the mean bias effect (g1, bk, g2, bk) based on the treatments being compared.

where m = 1, 2. This approach assumes a common mean bias for studies that compare active treatments with an inactive treatment (placebo, standard or no treatment). For active vs active comparisons, we could assume either a zero mean bias effect or a common bias effect gmact. The direction of bias dirbk in studies that compare active treatments with each other should be defined in the data. That is set to be either 0, meaning that bias favors b over k, or 1 , meaning that k is favored to b. In crossnma.model(), the bias direction is specified by providing the unfavoured treatment for each study, unfav. To select which mean bias effect should be applied, the user can provide the bias.group column as data. Its values can be 0 (no bias adjustment), 1 (to assign for the comparison mean bias effect gm) or 2 (to set bias gmact).

Another parameterisation of the logistic model with additive bias effect is

NMR model for IPD studies

NMR model for AD studies

Then the bias-adjusted relative treatment effect (δjbkbias = δjbk + γjbk) can be assumed exchangeable across studies δjbkbias ∼ 𝒩(gbk + dAk − dAb, τ2/qj) or fixed as δjbkbias = gbk + dAk − dAb. In this parameterisation, instead of assigning prior to the between-study heterogeneity in bias effect τγ, we model the RoB weight qj = τ2/(τ2 + τγ2) for each study. This quantity 0 < qj < 1 quantifies the proportion of the between-study heterogeneity that is not explained by accounting for risk of bias. The values of v determine the extent studies at high risk of bias will be down-weighted on average. Setting v = 1 gives E(qj) = v/(v + 1) = 0.5, which means that high risk of bias studies will be penalized by 50% on average. In crossnma.model(), the user can assign the average down-weight E(qj) to the argument down.wgt.

Bias-adjusted model 2

Another way to incorporate the RoB of the study is by replacing δjbk by a “bias-adjusted” relative treatment effect θjbk. Then θjbk is modeled with a bimodal normal distribution as described in Section 2.5. For more details see Verde (2020).

NMR model for IPD studies

NMR model for AD studies

where the bias-adjusted relative treatment effect (θjk) are modeled via random-effects model with a mixture of two normal distributions.

θjbk ∼ (1 − πj)𝒩(dAk − dAb, τ2) + πj𝒩(dAk − dAb + γjbk, τ2 + τγ2)

Alternatively, we can summarize these relative effects assuming a common-effect model

θjbk = dAk − dAb + πjγjbk

Assumptions about the model parameters

The table below summarizes the different assumptions implemented in the package about combining the parameters in the models described above.

Parameter Assumptions Argument in crossnma.model()
Relative treatment effect (δjbk) Random-effects: δjbk ∼ 𝒩(dAk − dAb, τ2) trt.effect='random'
Common-effect: δjbk = dAk − dAb trt.effect='common'
Covariate effect (β0j) Independent effects: β0j ∼ 𝒩(0, 102) reg0.effect='independent'
Random-effects: β0j ∼ 𝒩(B0, τ02) reg0.effect='random'
Within-study covariate-treatment Independent effects: β1, jbkW ∼ 𝒩(0, 102) regw.effect='independent'
interaction (β1, jbkW) Random-effects: β1, jbkW ∼ 𝒩(B1, AkW − B1, AbW, τW2) regw.effect='random'
Common-effect: β1, jbkW = B1, AkW − B1, AbW regw.effect='common'
Between-study covariate-treatment Independent effects: β1, jbkB ∼ 𝒩(0, 102) regb.effect='independent'
interaction (β1, jbkB) Random-effects: β1, jbkB ∼ 𝒩(B1, AkB − B1, AbB, τB2) regb.effect='random'
Common-effect: β1, jbkB = B1, AkB − B1, AbB regb.effect='common'
Bias effect (γm, jbk), m = 1, 2 Random-effects: γm, jbk ∼ 𝒩(gm, bk, τm, γ2) bias.effect='random'
Common-effect: γm, jbk = gm, bk bias.effect='common'
Mean bias effect gm, bk The treatment k is active.  gm, bk = gm (b inactive),  gm, bk = 0 (b active & no bias)  gm, bk = gmact(b active & bias) unfav=0, bias.group=1  unfav=1, bias.group=0  unfav=1, bias.group=2
Bias probability (πj) πj ∼ Beta(a1, a2) pi.high.nrs, pi.low.nrs, pi.high.rct, pi.low.rct
πj = e + fzj bias.covariate

Synthesis of studies comparing drugs for relapsing-remitting multiple sclerosis

Description of the data

The data we use are fictitious but resemble real RCTs with IPD and aggregate data included in Tramacere and Filippini (2015). The studies provide either individual participant data ipddata (3 RCTs and 1 cohort study) or aggregate data stddata (2 RCTs). In total, four drugs are compared which are anonymized.

The ipddata contains 1944 participants / rows. We display the first few rows of the data set:

dim(ipddata)
#> [1] 1944   10
head(ipddata)
#>   id relapse treat design age sex rob unfavored bias.group year
#> 1  1       0     D    rct  22   1 low         1          1 2002
#> 2  1       0     D    rct  31   1 low         1          1 2002
#> 3  1       0     D    rct  34   1 low         1          1 2002
#> 4  1       0     D    rct  38   0 low         1          1 2002
#> 5  1       0     D    rct  46   0 low         1          1 2002
#> 6  1       0     D    rct  45   0 low         1          1 2002

For each participant, we have information for the outcome relapse (0 = no, 1 = yes), the treatment label treat, the age (in years) and sex (0 = female, 1 = male) of the participant. The following columns are set on study-level (it is repeated for each participant in each study): the id, the design of the study (needs to be either "rct" or "nrs"), the risk of bias rob on each study (can be set as low, high or unclear), the year of publication, the bias.group for the study comparison and the study unfavoured treatment unfavored.

The aggregate meta-analysis data must be in long arm-based format with the exact same variable names and an additional variable with the sample sizes:

stddata
#>   id   n relapse treat design  age sex  rob unfavored bias.group year
#> 1  1  25      19     A    rct 34.3 0.2 high         0          1 2010
#> 2  1  25      11     C    rct 34.3 0.3 high         1          1 2010
#> 3  2 126      97     A    rct 30.0 0.4 high         0          1 2015
#> 4  2 125      89     C    rct 30.0 0.5 high         1          1 2015

Analysis

There are two steps to run the NMA/NMR model. The first step is to create a JAGS model using crossnma.model() which produces the JAGS code and the data. In the second step, the output of that function will be used in crossnma() to run the analysis through JAGS.

Unadjusted network meta-analysis

We start by providing the essential variables which - as stated earlier - must have equal names in both data sets. Next, we give the names of the datasets on participant-level (argument prt.data) and aggregate data (argument std.data). By default, binary data is analyzed using the odds ratio as a summary measure (sm = "OR"). The reference treatment can be assigned which by default is the first treatment (here: drug A). By default (trt.effect = "random"), we are assigning a normal distribution to each relative treatment effect to allow the synthesis across studies, see the table in Section 2.1. The different designs; RCT and NRS are combined with the information taken at face-value as method.bias = "naive".

Optionally, we can specify a prior to the common heterogeneity of the treatment effect across studies. We indicate that distribution in the argument prior.tau.trt = "dunif(0, 3)".

Finally, we calculate the Surface Under the Cumulative Ranking (SUCRA) in order to rank the treatments. It is essential to specify argument small.values to get the correct ranking. For the RRMS studies, a small number of relapses is desirable.

# JAGS model: code + data
mod1 <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  #---------- bias adjustment ----------
  method.bias = "naive",
  #---------- assign a prior ----------
  prior.tau.trt = "dunif(0, 3)",
  #---------- SUCRA ----------
  sucra = TRUE, small.values = "desirable"
  )
#> Both designs are combined naively without acknowledging design differences.

The network should be checked for its connectivity before running the analysis. This is a vital step as the model will run even if the network is not connected.

netgraph(mod1, cex.points = n.trts, adj = 0.5, plastic = FALSE,
 number = TRUE, pos.number.of.studies = c(0.5, 0.4, 0.5, 0.5, 0.6, 0.5))

We are using argument number.of.studies = TRUE in order to print the number of studies in each direct comparison. The position of the number of studies is set by argument pos.number.of.studies.

Next, we fit the NMA model using crossnma(). We change the default settings for the number of iterations, burn-in and thinning.

# Run JAGS
jagsfit1 <- crossnma(mod1, n.iter = 5000, n.burnin = 2000, thin = 1)
jagsfit1
#>           Mean    SD  2.5%   50% 97.5%  Rhat n.eff
#> exp(d.A)     .     .     .     .     .     .     .
#> exp(d.B) 0.470 0.194 0.322 0.468 0.692 1.009   865
#> exp(d.C) 0.629 0.211 0.416 0.629 0.944 1.015   582
#> exp(d.D) 0.341 0.265 0.202 0.341 0.571 1.004   671
#> tau      0.188 0.182 0.002 0.140 0.673 1.044   241
#> SUCRA.A  0.006 0.047 0.000 0.000 0.000 1.010  2547
#> SUCRA.B  0.680 0.153 0.333 0.667 1.000 1.000  1349
#> SUCRA.C  0.368 0.128 0.333 0.333 0.667 1.004  1382
#> SUCRA.D  0.947 0.142 0.667 1.000 1.000 1.000  1013
#> Mean and quantiles are exponentiated

By default (argument backtransf = TRUE), estimated odds ratios, i.e., exp(d.B), exp(d.C) and exp(d.D), are printed. The value of tau refers to the estimates of the heterogeneity standard deviation in the relative treatment effects d.B, d.C and d.D across studies. The SUCRA values are probabilities with treatment D being notably superior to the other treatments.

We summarize the estimated parameters (argument backtransf = FALSE) in the following table.

Mean SD 2.5% 50% 97.5% Rhat n.eff
d.A . . . . . . .
d.B -0.755 0.194 -1.133 -0.759 -0.368 1.009 865
d.C -0.463 0.211 -0.878 -0.463 -0.058 1.015 582
d.D -1.076 0.265 -1.602 -1.077 -0.560 1.004 671
tau 0.188 0.182 0.002 0.140 0.673 1.044 241
SUCRA.A 0.006 0.047 0.000 0.000 0.000 1.010 2547
SUCRA.B 0.680 0.153 0.333 0.667 1.000 1.000 1349
SUCRA.C 0.368 0.128 0.333 0.333 0.667 1.004 1382
SUCRA.D 0.947 0.142 0.667 1.000 1.000 1.000 1013

We need also to assess the convergence of the MCMC chains either by checking the Gelman and Rubin statistic, Rhat (it should be approximately 1) in the table above or visually inspect the trace plot.

par(mar = rep(2, 4), mfrow = c(2, 3))
plot(jagsfit1)

Unadjusted network meta-regression

In this part, we set argument cov1 = age to run a NMR model with one covariate. Again, datasets ipddata and stddata must use the same variable name.

# JAGS model: code + data
mod2 <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  #---------- bias adjustment ----------
  method.bias = "naive",
  #----------  meta-regression ----------
  cov1 = age,
  split.regcoef = FALSE
  )
#> Both designs are combined naively without acknowledging design differences.

We could add two more covariates to the NMR model using arguments cov2 and cov3.

The MCMC is run under the same set up as in the network meta-analysis.

# Run JAGS
jagsfit2 <- crossnma(mod2, n.iter = 5000, n.burnin = 2000, thin = 1)

and the output table is presented below

Mean SD 2.5% 50% 97.5% Rhat n.eff
d.A . . . . . . .
d.B -0.899 0.347 -1.583 -0.894 -0.239 1.001 97
d.C -0.468 0.377 -1.199 -0.464 0.283 1.006 127
d.D -0.975 0.493 -1.896 -0.987 0.135 1.018 103
b_1 0.000 0.067 -0.116 0.000 0.106 1.074 3300
tau 0.220 0.193 0.008 0.170 0.726 1.024 219
tau.b_1 0.056 0.101 0.001 0.023 0.412 1.098 112

Now, we additionally estimate b_1 which indicates the mean effect of age and tau.b_1 which refers to the heterogeneity standard deviation in the effect of age across studies. Here, we obtain a single estimate because we choose to not split the within- and between-study age coefficients (β1, jbkw = β1, jbkB = β1, jbk) to improve the convergence of MCMC.

The league table summarizes the relative effect with the 95% credible interval of each treatment on the top compared to the treatment on the left. All estimates are computed for participant age 38. We can display the table in wide format

league(jagsfit2, cov1.value = 38, digits = 2)
#>                                                             
#>                    A 0.41 (0.21 to 0.79) 0.63 (0.30 to 1.33)
#>  2.44 (1.27 to 4.87)                   B 1.51 (0.75 to 3.38)
#>  1.59 (0.75 to 3.32) 0.66 (0.30 to 1.33)                   C
#>  2.68 (0.87 to 6.66) 1.11 (0.34 to 2.79) 1.67 (0.56 to 4.57)
#>                     
#>  0.37 (0.15 to 1.14)
#>  0.90 (0.36 to 2.95)
#>  0.60 (0.22 to 1.79)
#>                    D

or in long format

league(jagsfit2, cov1.value = 38, digits = 2, direction = "long")
#>  Treatment Comparator median 2.5% 97.5%
#>          B          A   0.41 0.21  0.79
#>          C          A   0.63 0.30  1.33
#>          D          A   0.37 0.15  1.14
#>          A          B   2.44 1.27  4.87
#>          C          B   1.51 0.75  3.38
#>          D          B   0.90 0.36  2.95
#>          A          C   1.59 0.75  3.32
#>          B          C   0.66 0.30  1.33
#>          D          C   0.60 0.22  1.79
#>          A          D   2.68 0.87  6.66
#>          B          D   1.11 0.34  2.79
#>          C          D   1.67 0.56  4.57

Using non-randomized studies (NRS) to construct priors for the treatment effects

To run NMA with a prior constructed from NRS, two additional arguments are needed: we indicate using NRS as a prior by setting method.bias = "prior". That means that the model runs internally NMA with only NRS data which are then used to construct informative priors. This requires defining MCMC settings (the number of adaptations, iterations, burn-ins, thinning and chains) in the arguments starts with run.nrs.

In this method, the prior for the basic parameters is set to a normal distribution. For basic parameters not examined in the NRS, the code sets a minimally informative prior d~dnorm(0, {15*ML}^2), where ML is the largest maximum likelihood estimates of all relative treatment effects in all studies. To account for possible bias, the means of the distribution can be shifted by run.nrs.mean.shift and/or the variance can be inflated by run.nrs.var.infl to control the influence of NRS on the final estimation.

# JAGS model: code + data
mod3 <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  reference = "D",
  #----------  meta-regression ----------
  cov1 = age,
  split.regcoef = FALSE,
  #---------- bias adjustment ----------
  method.bias = "prior",
  run.nrs.trt.effect= "common",
  run.nrs.var.infl = 0.6, run.nrs.mean.shift = 0,
  run.nrs.n.iter = 10000, run.nrs.n.burnin = 4000,
  run.nrs.thin = 1, run.nrs.n.chains = 2
  )
# Run JAGS
jagsfit3 <- crossnma(mod3, n.iter = 5000, n.burnin = 2000, thin = 1)

The heat plot summarizes the relative effect with the 95% credible interval of each treatment on the top compared to the treatment on the left. All estimates are computed for participant age 38.

heatplot(jagsfit3, cov1.value = 38,
  size = 6, size.trt = 20, size.axis = 12)

Bias-adjusted model 1

In this part, the overall relative treatment effects are estimated from both NRS and RCT with adjustment to study-specific bias.

To fit the model, we set method.bias = "adjust1" and we need to provide the bias variable bias = rob in the datasets. The direction of bias is determined by the column unfav = unfavored which indicates the unfavoured treatment. The mean bias effect can be indicated by bias.group, 0 (bias.group = 0), g (bias.group = 1) or gact (bias.group = 2). By default, the effect of bias is assumed to be additive bias.type = "add" and equal across studies bias.effect = "common". We also use the year of study publication to estimate the study-probability of bias, bias.covariate = year.

# JAGS model: code + data
mod4 <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  #---------- bias adjustment ----------
  method.bias = "adjust1",
  bias.type = "add",
  bias.effect = "common",
  bias = rob,
  unfav = unfavored,
  bias.group = bias.group,
  bias.covariate = year
)
#> Bias effect is assumed common across studies
# Run JAGS
jagsfit4 <- crossnma(mod4, n.iter = 5000, n.burnin = 2000, thin = 1)

The results are presented below

Mean SD 2.5% 50% 97.5% Rhat n.eff
d.A . . . . . . .
d.B -0.767 0.213 -1.189 -0.774 -0.310 1.012 1343
d.C -0.474 0.224 -0.933 -0.473 -0.035 1.010 596
d.D -1.073 0.280 -1.641 -1.070 -0.543 1.016 1028
g -0.076 19.786 -38.139 -0.318 39.382 1.000 6673
tau 0.225 0.191 0.012 0.175 0.717 1.051 196

The parameter g refers to the mean bias effect, common for all studies.

Bias-adjusted model 2

The arguments for method.bias = "adjust2" are similar to the ones used before in method.bias = "adjust1".

# JAGS model: code + data
mod5 <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  #---------- bias adjustment ----------
  method.bias = "adjust2",
  bias.type = "add",
  bias = rob,
  unfav = unfavored,
  bias.group = bias.group
)
# Run JAGS
jagsfit5 <- crossnma(mod5, n.iter = 5000, n.burnin = 2000, thin = 1)
Mean SD 2.5% 50% 97.5% Rhat n.eff
d.A . . . . . . .
d.B -0.755 0.285 -1.297 -0.776 -0.163 1.009 387
d.C -0.482 0.262 -1.074 -0.461 0.045 1.010 420
d.D -1.094 0.359 -1.913 -1.070 -0.417 1.025 585
g 0.009 0.366 -0.747 0.029 0.721 1.049 238
tau 0.291 0.247 0.001 0.225 0.941 1.018 100

References

Dias, Sofia, N. J. Welton, V. C. C. Marinho, G. Salanti, J. P. T Higgins, and A. E. Ades. 2010. “Estimation and Adjustment of Bias in Randomized Evidence by Using Mixed Treatment Comparison Meta-Analysis.” Journal of the Royal Statistical Society 173: 613–29.
Plummer, Martyn. 2003. JAGS: A Program for Analysis of Bayesian Graphical Models Using Gibbs Sampling.”
Tramacere, Del Giovane, I, and G Filippini. 2015. “Immunomodulators and Immunosuppressants for Relapsing‐remitting Multiple Sclerosis: A Network Meta‐analysis.” Cochrane Database of Systematic Reviews, no. 9. https://doi.org/10.1002/14651858.CD011381.pub2.
Verde, Pablo Emilio. 2020. “A Bias-Corrected Meta-Analysis Model for Combining, Studies of Different Types and Quality.” Biometrical Journal.