This vignette shows how to run a network meta-analysis with network_meta() using both multilevel and multivariate fitting strategies, and how to extract:

  1. Direct effects
  2. Indirect effects
  3. Total effects
  4. Standard errors for direct, indirect, and total effects
  5. Normal-approximation confidence intervals for direct, indirect, and total effects
  6. Number of direct and indirect effects and contributing studies by comparison
  7. Heterogeneity summaries (Q and I^2, total and within)
  8. Between-study variance (tau^2) by model component/level
  9. Incoherence-factor assessment (per-comparison and global)
  10. Contribution matrix (% information from direct comparisons)
  11. Treatment ranking/order and rank probabilities
  12. Node-splitting direct-vs-indirect comparisons
  13. Fit-stat summaries and lightweight model comparison helper
library(mars)

Example Network Data

Each row is an observed contrast with effect defined as treatment_2 - treatment_1.

nma_dat <- data.frame(
  study = c("s1", "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11"),
  trt1  = c("A", "A", "A", "B", "A", "B", "C", "A", "B", "C", "A", "B"),
  trt2  = c("B", "C", "B", "C", "D", "D", "D", "C", "D", "D", "B", "C"),
  yi    = c(0.22, 0.41, 0.18, 0.19, 0.61, 0.39, 0.23, 0.37, 0.43, 0.18, 0.24, 0.20),
  vi    = c(0.04, 0.05, 0.03, 0.04, 0.06, 0.05, 0.05, 0.04, 0.06, 0.05, 0.04, 0.04),
  stringsAsFactors = FALSE
)

nma_dat
#>    study trt1 trt2   yi   vi
#> 1     s1    A    B 0.22 0.04
#> 2     s1    A    C 0.41 0.05
#> 3     s2    A    B 0.18 0.03
#> 4     s3    B    C 0.19 0.04
#> 5     s4    A    D 0.61 0.06
#> 6     s5    B    D 0.39 0.05
#> 7     s6    C    D 0.23 0.05
#> 8     s7    A    C 0.37 0.04
#> 9     s8    B    D 0.43 0.06
#> 10    s9    C    D 0.18 0.05
#> 11   s10    A    B 0.24 0.04
#> 12   s11    B    C 0.20 0.04

Multilevel Network Meta-analysis

Multilevel network meta-analysis always estimates flexible heterogeneity by random level. tau_components chooses the component definition.

nma_ml_flexible <- network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multilevel",
  tau_components = "comparison",
  ci_level = 0.90,
  estimation_method = "MLE"
)

summary(nma_ml_flexible)
#> Network Meta-analysis (MARS)
#> Model Type: multilevel 
#> Heterogeneity: flexible 
#> Tau components: comparison 
#> Reference: A 
#> Treatments: A, B, C, D 
#> 
#> Evidence Summary:
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
#> 
#> 
#> Incoherence-Factor Assessment:
#> Global test:
#>  Q_incoherence df    p_value
#>        10.7599  6 0.09608667
#> 
#> Per-comparison incoherence factors:
#>  treatment_1 treatment_2 incoherence_factor     if_se         z    p_value
#>            A           B          0.2143952 0.1826015 1.1741152 0.24034887
#>            A           C          0.3762058 0.2368238 1.5885474 0.11216261
#>            A           D          0.6124295 0.3638213 1.6833250 0.09231219
#>            B           C          0.1962550 0.2255820 0.8699938 0.38430377
#>            B           D          0.4143979 0.2564005 1.6162133 0.10604821
#>            C           D          0.2017792 0.2492718 0.8094749 0.41824205
#>     ci_lower  ci_upper
#>  -0.14349719 0.5722877
#>  -0.08796027 0.8403719
#>  -0.10064714 1.3255061
#>  -0.24587769 0.6383877
#>  -0.08813784 0.9169335
#>  -0.28678445 0.6903429
#> 
#> Contribution Matrix (% information from direct comparisons):
#>        A vs B A vs C A vs D B vs C B vs D C vs D
#> A vs B  90.37   4.42   0.29   3.82   1.04   0.06
#> A vs C  41.34  36.50   0.66  16.71   0.59   4.21
#> A vs D  50.86  12.36   3.52   0.64  16.35  16.26
#> B vs C  29.11  13.62   0.03  46.64   4.49   6.11
#> B vs D  24.22   1.45   2.15  13.68  38.74  19.76
#> C vs D   1.08   8.82   1.80  15.68  16.64  55.98
#> 
#> Model Fixed Effects (SE fallback applied when needed):
#>  term  estimate  std_error  z_value      p_value se_source
#>   d_B 0.2056048 0.06449319 3.188007 1.432571e-03   hessian
#>   d_C 0.3993498 0.07557253 5.284324 1.261696e-07   hessian
#>   d_D 0.6075705 0.08147836 7.456833 8.862676e-14   hessian
#> 
#> Fit Statistics:
#>  model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p   logLik
#>        <NA>          <NA>            0      NA      <NA> NA    NA   NA 3.204918
#>       Dev      AIC      BIC     AICc
#>  9.590164 3.590164 6.014697 223.5902
#> 
#> Node-Splitting Assessment:
#>  Q_node_split df    p_value
#>       10.7599  6 0.09608667
#> 
#>  treatment_1 treatment_2    direct     indirect direct_indirect_diff   diff_se
#>            A           B 0.2100000 -0.004395249            0.2143952 0.1826015
#>            A           C 0.3877778  0.011571989            0.3762058 0.2368238
#>            A           D 0.6100000 -0.002429464            0.6124295 0.3638213
#>            B           C 0.1950000 -0.001254985            0.1962550 0.2255820
#>            B           D 0.4081818 -0.006216033            0.4143979 0.2564005
#>            C           D 0.2050000  0.003220770            0.2017792 0.2492718
#>          z    p_value    ci_lower  ci_upper
#>  1.1741152 0.24034887 -0.14349719 0.5722877
#>  1.5885474 0.11216261 -0.08796027 0.8403719
#>  1.6833250 0.09231219 -0.10064714 1.3255061
#>  0.8699938 0.38430377 -0.24587769 0.6383877
#>  1.6162133 0.10604821 -0.08813784 0.9169335
#>  0.8094749 0.41824205 -0.28678445 0.6903429
#> 
#> Treatment Ranking:
#>  treatment mean_effect  std_error mean_rank median_rank    sucra   sucr_a
#>          D   0.6075705 0.11120217   1.03100           1 98.96667 98.96667
#>          C   0.3993498 0.10789372   1.99725           2 66.75833 66.75833
#>          B   0.2056048 0.09666086   2.98825           3 33.72500 33.72500
#>          A   0.0000000 0.00000000   3.98350           4  0.55000  0.55000
#>  p_best
#>   0.969
#>   0.031
#>   0.000
#>   0.000
#> 
#> Contribution Decomposition (top rows):
#> Fixed-Effect Design Diagnostics:
#> $rank
#> [1] NA
#> 
#> $ncol
#> [1] 3
#> 
#> $condition_number
#> [1] 4.269992
#> 
#> $info_condition_number
#> [1] NA
#> 
#> $singular
#> [1] TRUE
#> 
#> $near_singular
#> [1] FALSE
#> 
#> $recommendation
#> [1] "Fixed-effect information matrix is rank-deficient/ill-conditioned; consider simplifying contrasts, merging sparse levels, or adding regularization."
#> 
#> 
#> Treatment Order:
#>  rank treatment effect_vs_reference
#>     1         D              0.6076
#>     2         C              0.3993
#>     3         B              0.2056
#>     4         A              0.0000
#> 
#> Direct / Indirect / Total Effects:
#>  treatment_1 treatment_2 direct direct_se direct_n_studies direct_n_effects
#>            A           B 0.2100    0.1095                3                3
#>            A           C 0.3878    0.1491                2                2
#>            A           D 0.6100    0.2449                1                1
#>            B           C 0.1950    0.1414                2                2
#>            B           D 0.4082    0.1651                2                2
#>            C           D 0.2050    0.1581                2                2
#>  direct_observed direct_observed_se indirect indirect_se indirect_n_paths
#>           0.2100             0.1095  -0.0044      0.1461                2
#>           0.3878             0.1491   0.0116      0.1840                2
#>           0.6100             0.2449  -0.0024      0.2690                2
#>           0.1950             0.1414  -0.0013      0.1757                2
#>           0.4082             0.1651  -0.0062      0.1961                2
#>           0.2050             0.1581   0.0032      0.1927                2
#>  indirect_n_studies indirect_n_effects  total total_se total_n_studies
#>                   7                  7 0.2056   0.0967               9
#>                   8                  8 0.3993   0.1079               9
#>                   8                  9 0.6076   0.1112               9
#>                   8                  9 0.1937   0.1043              10
#>                   8                  8 0.4020   0.1058              10
#>                   7                  7 0.2082   0.1102               9
#>  total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#>               10          0.0298          0.3902                   0.0298
#>               10          0.1426          0.6330                   0.1426
#>               10          0.2071          1.0129                   0.2071
#>               11         -0.0376          0.4276                  -0.0376
#>               10          0.1365          0.6798                   0.1365
#>                9         -0.0551          0.4651                  -0.0551
#>  direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#>                    0.3902           -0.2447            0.2359         0.0466
#>                    0.6330           -0.2911            0.3143         0.2219
#>                    1.0129           -0.4449            0.4401         0.4247
#>                    0.4276           -0.2903            0.2878         0.0221
#>                    0.6798           -0.3288            0.3164         0.2279
#>                    0.4651           -0.3138            0.3202         0.0270
#>  total_ci_upper
#>          0.3646
#>          0.5768
#>          0.7905
#>          0.3654
#>          0.5760
#>          0.3894
#> 
#> Indirect SE note:
#> Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance. 
#> 
#> Heterogeneity Summary:
#> Overall Q:
#> $value
#>           [,1]
#> [1,] 0.1092282
#> 
#> $df
#> [1] 9
#> 
#> $p
#>      [,1]
#> [1,]    1
#> 
#> 
#> Q by random effect level:
#>         level           Q df   p_value n_groups
#>      study_id 0.000155828  1 0.9900402        1
#>  component_id 0.000000000  0        NA        0
#> 
#> Level-specific I2 / Tau2:
#>     component  tau2           Q df   p_value n_groups          I2
#>  component_id 1e-06 0.000000000  0        NA        0 0.002867794
#>      study_id 1e-06 0.000155828  1 0.9900402        1 0.002867794
#> 
#> Total I^2:
#> [1] 0.001147137
#> 
#> Within I^2:
#> [1] 0.002867794 0.002867794
#> 
#> Between-study variance (tau^2):
#>     component  tau2
#>      study_id 1e-06
#>  component_id 1e-06

League table of total effects:

nma_ml_flexible$league_table
#>            A          B          C         D
#> A  0.0000000  0.2056048  0.3993498 0.6075705
#> B -0.2056048  0.0000000  0.1937450 0.4019658
#> C -0.3993498 -0.1937450  0.0000000 0.2082208
#> D -0.6075705 -0.4019658 -0.2082208 0.0000000

Per-comparison study contributions and indirect SEs:

nma_ml_flexible$effects[, c(
  "treatment_1", "treatment_2",
  "direct_n_studies", "indirect_n_studies", "total_n_studies",
  "indirect", "indirect_se", "indirect_ci_lower", "indirect_ci_upper",
  "total", "total_se", "total_ci_lower", "total_ci_upper"
)]
#>   treatment_1 treatment_2 direct_n_studies indirect_n_studies total_n_studies
#> 1           A           B                3                  7               9
#> 2           A           C                2                  8               9
#> 3           A           D                1                  8               9
#> 4           B           C                2                  8              10
#> 5           B           D                2                  8              10
#> 6           C           D                2                  7               9
#>       indirect indirect_se indirect_ci_lower indirect_ci_upper     total
#> 1 -0.004395249   0.1460935        -0.2446977         0.2359072 0.2056048
#> 2  0.011571989   0.1840198        -0.2911136         0.3142576 0.3993498
#> 3 -0.002429464   0.2690092        -0.4449101         0.4400512 0.6075705
#> 4 -0.001254985   0.1757477        -0.2903342         0.2878243 0.1937450
#> 5 -0.006216033   0.1961338        -0.3288275         0.3163954 0.4019658
#> 6  0.003220770   0.1927081        -0.3137559         0.3201974 0.2082208
#>     total_se total_ci_lower total_ci_upper
#> 1 0.09666086     0.04661178      0.3645977
#> 2 0.10789372     0.22188039      0.5768191
#> 3 0.11120217     0.42465924      0.7904818
#> 4 0.10434202     0.02211767      0.3653724
#> 5 0.10580996     0.22792389      0.5760077
#> 6 0.11016539     0.02701483      0.3894267

For flexible multilevel models, tau^2 is reported by random level/component:

nma_ml_flexible$heterogeneity_summary$tau2
#>      component  tau2
#> 1     study_id 1e-06
#> 2 component_id 1e-06

For multilevel models, Q is also broken out by random/nested level:

nma_ml_flexible$heterogeneity_summary$Q_by_level
#>          level           Q df   p_value n_groups
#> 1     study_id 0.000155828  1 0.9900402        1
#> 2 component_id 0.000000000  0        NA        0

Incoherence-factor assessment for multilevel NMA:

nma_ml_flexible$incoherence_assessment$global
#>   Q_incoherence df    p_value
#> 1       10.7599  6 0.09608667
nma_ml_flexible$incoherence_assessment$per_comparison
#>   treatment_1 treatment_2 incoherence_factor     if_se         z    p_value
#> 1           A           B          0.2143952 0.1826015 1.1741152 0.24034887
#> 2           A           C          0.3762058 0.2368238 1.5885474 0.11216261
#> 3           A           D          0.6124295 0.3638213 1.6833250 0.09231219
#> 4           B           C          0.1962550 0.2255820 0.8699938 0.38430377
#> 5           B           D          0.4143979 0.2564005 1.6162133 0.10604821
#> 6           C           D          0.2017792 0.2492718 0.8094749 0.41824205
#>      ci_lower  ci_upper
#> 1 -0.14349719 0.5722877
#> 2 -0.08796027 0.8403719
#> 3 -0.10064714 1.3255061
#> 4 -0.24587769 0.6383877
#> 5 -0.08813784 0.9169335
#> 6 -0.28678445 0.6903429

Node-splitting for key direct/indirect contrasts:

nma_ml_flexible$node_splitting$global
#>   Q_node_split df    p_value
#> 1      10.7599  6 0.09608667
head(nma_ml_flexible$node_splitting$per_comparison)
#>   treatment_1 treatment_2    direct     indirect direct_indirect_diff   diff_se
#> 1           A           B 0.2100000 -0.004395249            0.2143952 0.1826015
#> 2           A           C 0.3877778  0.011571989            0.3762058 0.2368238
#> 3           A           D 0.6100000 -0.002429464            0.6124295 0.3638213
#> 4           B           C 0.1950000 -0.001254985            0.1962550 0.2255820
#> 5           B           D 0.4081818 -0.006216033            0.4143979 0.2564005
#> 6           C           D 0.2050000  0.003220770            0.2017792 0.2492718
#>           z    p_value    ci_lower  ci_upper
#> 1 1.1741152 0.24034887 -0.14349719 0.5722877
#> 2 1.5885474 0.11216261 -0.08796027 0.8403719
#> 3 1.6833250 0.09231219 -0.10064714 1.3255061
#> 4 0.8699938 0.38430377 -0.24587769 0.6383877
#> 5 1.6162133 0.10604821 -0.08813784 0.9169335
#> 6 0.8094749 0.41824205 -0.28678445 0.6903429

Contribution decomposition by study/source block:

head(nma_ml_flexible$contribution_decomposition$by_study)
#> [1] treatment_1       treatment_2       source_edge       study            
#> [5] effect_percentage
#> <0 rows> (or 0-length row.names)
head(nma_ml_flexible$contribution_decomposition$by_edge_block)
#>   source_edge treatment_1 treatment_2 effect_percentage n_studies n_effects
#> 1      A vs B           A           B         90.368175         3         3
#> 2      A vs B           B           C         29.107446         3         3
#> 3      A vs B           A           C         41.342442         3         3
#> 4      A vs B           B           D         24.217443         3         3
#> 5      A vs B           C           D          1.076873         3         3
#> 6      A vs B           A           D         50.864110         3         3
#>   sum_inverse_variance effective_information weighted_effective_information
#> 1             83.33333              2.941176                     2.65788751
#> 2             83.33333              2.941176                     0.85610134
#> 3             83.33333              2.941176                     1.21595416
#> 4             83.33333              2.941176                     0.71227773
#> 5             83.33333              2.941176                     0.03167274
#> 6             83.33333              2.941176                     1.49600324
head(nma_ml_flexible$contribution_decomposition$effective_information$by_edge)
#>   source_edge n_studies n_effects sum_inverse_variance effective_information
#> 1      A vs B         3         3             83.33333              2.941176
#> 2      A vs C         2         2             45.00000              1.975610
#> 3      A vs D         1         1             16.66667              1.000000
#> 4      B vs C         2         2             50.00000              2.000000
#> 5      B vs D         2         2             36.66667              1.983607
#> 6      C vs D         2         2             40.00000              2.000000
head(nma_ml_flexible$contribution_decomposition$effective_information$by_edge_study)
#>   source_edge study n_effects sum_inverse_variance effective_information
#> 1      A vs B    s1         1             25.00000                     1
#> 2      A vs B   s10         1             25.00000                     1
#> 3      A vs B    s2         1             33.33333                     1
#> 4      A vs C    s1         1             20.00000                     1
#> 5      A vs C    s7         1             25.00000                     1
#> 6      A vs D    s4         1             16.66667                     1
head(nma_ml_flexible$contribution_decomposition$effective_information$by_comparison)
#>   treatment_1 treatment_2 weighted_effective_information
#> 1           A           B                             NA
#> 2           B           C                             NA
#> 3           A           C                             NA
#> 4           B           D                             NA
#> 5           C           D                             NA
#> 6           A           D                             NA

Fit statistics:

nma_ml_flexible$fit_stats
#>   model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p
#> 1       <NA>          <NA>            0      NA      <NA> NA    NA   NA
#>     logLik      Dev      AIC      BIC     AICc
#> 1 3.204918 9.590164 3.590164 6.014697 223.5902

Ranking output:

nma_ml_flexible$ranking$rankings
#>   treatment mean_effect  std_error mean_rank median_rank    sucra   sucr_a
#> D         D   0.6075705 0.11120217   1.03100           1 98.96667 98.96667
#> C         C   0.3993498 0.10789372   1.99725           2 66.75833 66.75833
#> B         B   0.2056048 0.09666086   2.98825           3 33.72500 33.72500
#> A         A   0.0000000 0.00000000   3.98350           4  0.55000  0.55000
#>   p_best
#> D  0.969
#> C  0.031
#> B  0.000
#> A  0.000
nma_ml_flexible$ranking$rank_probability[1:4, , drop = FALSE]
#>   rank_1  rank_2  rank_3 rank_4
#> A  0.000 0.00000 0.01650 0.9835
#> B  0.000 0.02825 0.95525 0.0165
#> C  0.031 0.94075 0.02825 0.0000
#> D  0.969 0.03100 0.00000 0.0000
nma_ml_flexible$league_table_ordered
#>   treatment_1 treatment_2     total   total_se total_ci_lower total_ci_upper
#> 3           A           D 0.6075705 0.11120217     0.42465924      0.7904818
#> 5           B           D 0.4019658 0.10580996     0.22792389      0.5760077
#> 2           A           C 0.3993498 0.10789372     0.22188039      0.5768191
#> 6           C           D 0.2082208 0.11016539     0.02701483      0.3894267
#> 1           A           B 0.2056048 0.09666086     0.04661178      0.3645977
#> 4           B           C 0.1937450 0.10434202     0.02211767      0.3653724
head(nma_ml_flexible$league_table_se)
#>   A B C D
#> A 0 0 0 0
#> B 0 0 0 0
#> C 0 0 0 0
#> D 0 0 0 0

Level-specific heterogeneity:

nma_ml_flexible$heterogeneity_summary$level_heterogeneity
#>      component  tau2           Q df   p_value n_groups          I2
#> 1 component_id 1e-06 0.000000000  0        NA        0 0.002867794
#> 2     study_id 1e-06 0.000155828  1 0.9900402        1 0.002867794

Contribution matrix for multilevel NMA:

nma_ml_flexible$contribution_matrix
#>           A vs B    A vs C     A vs D     B vs C     B vs D      C vs D
#> A vs B 90.368175  4.423892 0.28859562  3.8207366  1.0435139  0.05508629
#> A vs C 41.342442 36.496433 0.65531482 16.7057362  0.5851147  4.21495961
#> A vs D 50.864110 12.358909 3.52304713  0.6445192 16.3481046 16.26130979
#> B vs C 29.107446 13.618556 0.02785936 46.6434337  4.4913978  6.11130750
#> B vs D 24.217443  1.453047 2.15266159 13.6821576 38.7374037 19.75728756
#> C vs D  1.076873  8.817042 1.80366089 15.6818831 16.6424910 55.97804929

Multilevel with Moderators

nma_dat$severity <- rep(c(0.2, 0.5, 0.8), length.out = nrow(nma_dat))
nma_dat$followup_months <- rep(c(3, 6, 12), length.out = nrow(nma_dat))

nma_ml_mod <- network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multilevel",
  tau_components = "comparison",
  moderators = ~ severity + followup_months,
  estimation_method = "MLE"
)

summary(nma_ml_mod)
#> Network Meta-analysis (MARS)
#> Model Type: multilevel 
#> Heterogeneity: flexible 
#> Tau components: comparison 
#> Moderators: severity, followup_months 
#> Reference: A 
#> Treatments: A, B, C, D 
#> 
#> Evidence Summary:
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
#> 
#> 
#> Incoherence-Factor Assessment:
#> Global test:
#>  Q_incoherence df   p_value
#>       9.934809  6 0.1274243
#> 
#> Per-comparison incoherence factors:
#>  treatment_1 treatment_2 incoherence_factor     if_se          z   p_value
#>            A           B          0.2682828 0.4318174  0.6212876 0.5344104
#>            A           C         -0.3675848 0.3107142 -1.1830320 0.2367965
#>            A           D         -0.5633491 0.3546417 -1.5885022 0.1121728
#>            B           C          0.1833121 0.4221084  0.4342773 0.6640871
#>            B           D         -0.3921116 0.2060007 -1.9034481 0.0569821
#>            C           D         -0.1668590 0.1238819 -1.3469207 0.1780058
#>    ci_lower   ci_upper
#>  -0.5780638 1.11462940
#>  -0.9765735 0.24140380
#>  -1.2584341 0.13173582
#>  -0.6440051 1.01062924
#>  -0.7958655 0.01164232
#>  -0.4096630 0.07594494
#> 
#> Contribution Matrix (% information from direct comparisons):
#>        A vs B A vs C A vs D B vs C B vs D C vs D
#> A vs B      0   0.16   2.14      0  97.69   0.01
#> A vs C      0  99.87   0.11      0   0.00   0.02
#> A vs D      0   6.76  92.80      0   0.00   0.43
#> B vs C      0   4.89   1.81      0  93.29   0.02
#> B vs D      0   0.00   0.00      0 100.00   0.00
#> C vs D      0  72.80  26.93      0   0.00   0.27
#> 
#> Model Fixed Effects (SE fallback applied when needed):
#>             term     estimate std_error     z_value     p_value se_source
#>              d_B  0.198383855 0.1124218  1.76463798 0.077624628   hessian
#>              d_C  0.388405127 0.1925867  2.01678029 0.043718447   hessian
#>              d_D  0.596100819 0.2222841  2.68170722 0.007324753   hessian
#>         severity  0.122704339 1.6015608  0.07661547 0.938929449   hessian
#>  followup_months -0.007964814 0.1008835 -0.07895058 0.937071935   hessian
#> 
#> Fit Statistics:
#>  model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p   logLik
#>        <NA>          <NA>            0      NA      <NA> NA    NA   NA 3.609517
#>       Dev      AIC      BIC     AICc
#>  16.78097 6.780967 10.17531 -133.219
#> 
#> Node-Splitting Assessment:
#>  Q_node_split df   p_value
#>      9.934809  6 0.1274243
#> 
#>  treatment_1 treatment_2      direct     indirect direct_indirect_diff
#>            A           B 0.233333333 -0.034949478            0.2682828
#>            A           C 0.010410142  0.377994985           -0.3675848
#>            A           D 0.016375839  0.579724980           -0.5633491
#>            B           C 0.186666667  0.003354605            0.1833121
#>            B           D 0.002802677  0.394914287           -0.3921116
#>            C           D 0.020418327  0.187277366           -0.1668590
#>    diff_se          z   p_value   ci_lower   ci_upper
#>  0.4318174  0.6212876 0.5344104 -0.5780638 1.11462940
#>  0.3107142 -1.1830320 0.2367965 -0.9765735 0.24140380
#>  0.3546417 -1.5885022 0.1121728 -1.2584341 0.13173582
#>  0.4221084  0.4342773 0.6640871 -0.6440051 1.01062924
#>  0.2060007 -1.9034481 0.0569821 -0.7958655 0.01164232
#>  0.1238819 -1.3469207 0.1780058 -0.4096630 0.07594494
#> 
#> Treatment Ranking:
#>  treatment mean_effect std_error mean_rank median_rank    sucra   sucr_a
#>          D   0.5961008 0.3545198   1.10650           1 96.45000 96.45000
#>          C   0.3884051 0.3106627   2.18450           2 60.51667 60.51667
#>          B   0.1983839 0.1938489   3.00675           3 33.10833 33.10833
#>          A   0.0000000 0.0000000   3.70225           4  9.92500  9.92500
#>   p_best
#>  0.92600
#>  0.02600
#>  0.00675
#>  0.04125
#> 
#> Contribution Decomposition (top rows):
#> Fixed-Effect Design Diagnostics:
#> $rank
#> [1] NA
#> 
#> $ncol
#> [1] 3
#> 
#> $condition_number
#> [1] 43.11314
#> 
#> $info_condition_number
#> [1] NA
#> 
#> $singular
#> [1] TRUE
#> 
#> $near_singular
#> [1] FALSE
#> 
#> $recommendation
#> [1] "Fixed-effect information matrix is rank-deficient/ill-conditioned; consider simplifying contrasts, merging sparse levels, or adding regularization."
#> 
#> 
#> Treatment Order:
#>  rank treatment effect_vs_reference
#>     1         D              0.5961
#>     2         C              0.3884
#>     3         B              0.1984
#>     4         A              0.0000
#> 
#> Direct / Indirect / Total Effects:
#>  treatment_1 treatment_2 direct direct_se direct_n_studies direct_n_effects
#>            A           B 0.2333    0.2728                3                3
#>            A           C 0.0104    0.0040                2                2
#>            A           D 0.0164    0.0066                1                1
#>            B           C 0.1867    0.2749                2                2
#>            B           D 0.0028    0.0011                2                2
#>            C           D 0.0204    0.0157                2                2
#>  direct_observed direct_observed_se indirect indirect_se indirect_n_paths
#>           0.2100             0.1095  -0.0349      0.3347                2
#>           0.3878             0.1491   0.3780      0.3107                2
#>           0.6100             0.2449   0.5797      0.3546                2
#>           0.1950             0.1414   0.0034      0.3203                2
#>           0.4082             0.1651   0.3949      0.2060                2
#>           0.2050             0.1581   0.1873      0.1229                2
#>  indirect_n_studies indirect_n_effects  total total_se total_n_studies
#>                   7                  7 0.1984   0.1938               9
#>                   8                  8 0.3884   0.3107               9
#>                   8                  9 0.5961   0.3545               9
#>                   8                  9 0.1900   0.1645              10
#>                   8                  8 0.3977   0.2060              10
#>                   7                  7 0.2077   0.1219               9
#>  total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#>               10         -0.3014          0.7681                  -0.0047
#>               10          0.0026          0.0183                   0.0956
#>               10          0.0035          0.0293                   0.1299
#>               11         -0.3521          0.7254                  -0.0822
#>               10          0.0006          0.0050                   0.0845
#>                9         -0.0104          0.0513                  -0.1049
#>  direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#>                    0.4247           -0.6909            0.6210        -0.1816
#>                    0.6800           -0.2309            0.9869        -0.2205
#>                    1.0901           -0.1152            1.2747        -0.0987
#>                    0.4722           -0.6245            0.6312        -0.1324
#>                    0.7319           -0.0088            0.7987        -0.0060
#>                    0.5149           -0.0536            0.4281        -0.0312
#>  total_ci_upper
#>          0.5783
#>          0.9973
#>          1.2909
#>          0.5125
#>          0.8015
#>          0.4465
#> 
#> Indirect SE note:
#> Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance. 
#> 
#> Heterogeneity Summary:
#> Overall Q:
#> $value
#>          [,1]
#> [1,] 0.106132
#> 
#> $df
#> [1] 7
#> 
#> $p
#>           [,1]
#> [1,] 0.9999972
#> 
#> 
#> Q by random effect level:
#>         level           Q df  p_value n_groups
#>      study_id 0.001859865  1 0.965601        1
#>  component_id 0.000000000  0       NA        0
#> 
#> Level-specific I2 / Tau2:
#>     component  tau2           Q df  p_value n_groups          I2
#>  component_id 1e-06 0.000000000  0       NA        0 0.003080906
#>      study_id 1e-06 0.001859865  1 0.965601        1 0.003080906
#> 
#> Total I^2:
#> [1] 0.0008802783
#> 
#> Within I^2:
#> [1] 0.003080906 0.003080906
#> 
#> Between-study variance (tau^2):
#>     component  tau2
#>      study_id 1e-06
#>  component_id 1e-06
nma_ml_mod$moderators
#> [1] "severity"        "followup_months"

You can optionally add deeper nested random-effect levels using nested_levels:

nma_dat$site <- rep(c("north", "south", "west"), length.out = nrow(nma_dat))
nma_dat$cohort <- rep(c("c1", "c2"), length.out = nrow(nma_dat))

nma_ml_nested <- network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multilevel",
  tau_components = "comparison",
  nested_levels = c("site", "cohort"),
  estimation_method = "MLE"
)
#> Warning in return_estimates(q_f = q_f, q_r = q_r, estimated_pars =
#> optim_values[["par"]], : Hessian inversion fallback: used eigen-based
#> pseudo-inverse; hessian may be singular/indefinite

summary(nma_ml_nested)
#> Network Meta-analysis (MARS)
#> Model Type: multilevel 
#> Heterogeneity: flexible 
#> Tau components: comparison 
#> Additional nested levels: site, cohort 
#> Reference: A 
#> Treatments: A, B, C, D 
#> 
#> Evidence Summary:
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
#> 
#> 
#> Incoherence-Factor Assessment:
#> Global test:
#>  Q_incoherence df    p_value
#>        10.7598  6 0.09608975
#> 
#> Per-comparison incoherence factors:
#>  treatment_1 treatment_2 incoherence_factor     if_se         z    p_value
#>            A           B          0.2143952 0.1826027 1.1741073 0.24035206
#>            A           C          0.3762058 0.2368249 1.5885401 0.11216426
#>            A           D          0.6124294 0.3638222 1.6833206 0.09231305
#>            B           C          0.1962550 0.2255831 0.8699900 0.38430588
#>            B           D          0.4143978 0.2564015 1.6162064 0.10604969
#>            C           D          0.2017791 0.2492729 0.8094707 0.41824442
#>     ci_lower  ci_upper
#>  -0.14349959 0.5722900
#>  -0.08796241 0.8403740
#>  -0.10064901 1.3255078
#>  -0.24587973 0.6383898
#>  -0.08813997 0.9169356
#>  -0.28678678 0.6903450
#> 
#> Contribution Matrix (% information from direct comparisons):
#>        A vs B A vs C A vs D B vs C B vs D C vs D
#> A vs B  90.37   4.42   0.29   3.82   1.04   0.06
#> A vs C  41.34  36.50   0.66  16.71   0.59   4.21
#> A vs D  50.86  12.36   3.52   0.64  16.35  16.26
#> B vs C  29.11  13.62   0.03  46.64   4.49   6.11
#> B vs D  24.22   1.45   2.15  13.68  38.74  19.76
#> C vs D   1.08   8.82   1.80  15.68  16.64  55.98
#> 
#> Model Fixed Effects (SE fallback applied when needed):
#>  term  estimate  std_error  z_value      p_value se_source
#>   d_B 0.2056048 0.06488447 3.168783 1.530789e-03   hessian
#>   d_C 0.3993497 0.07558430 5.283501 1.267379e-07   hessian
#>   d_D 0.6075706 0.08148260 7.456446 8.888728e-14   hessian
#> 
#> Fit Statistics:
#>  model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p   logLik
#>        <NA>          <NA>            0      NA      <NA> NA    NA   NA 3.204852
#>      Dev      AIC      BIC      AICc
#>  13.5903 7.590296 10.98464 -304.4097
#> 
#> Node-Splitting Assessment:
#>  Q_node_split df    p_value
#>       10.7598  6 0.09608975
#> 
#>  treatment_1 treatment_2    direct     indirect direct_indirect_diff   diff_se
#>            A           B 0.2100000 -0.004395213            0.2143952 0.1826027
#>            A           C 0.3877778  0.011571964            0.3762058 0.2368249
#>            A           D 0.6100000 -0.002429373            0.6124294 0.3638222
#>            B           C 0.1950000 -0.001255046            0.1962550 0.2255831
#>            B           D 0.4081818 -0.006215978            0.4143978 0.2564015
#>            C           D 0.2050000  0.003220886            0.2017791 0.2492729
#>          z    p_value    ci_lower  ci_upper
#>  1.1741073 0.24035206 -0.14349959 0.5722900
#>  1.5885401 0.11216426 -0.08796241 0.8403740
#>  1.6833206 0.09231305 -0.10064901 1.3255078
#>  0.8699900 0.38430588 -0.24587973 0.6383898
#>  1.6162064 0.10604969 -0.08813997 0.9169356
#>  0.8094707 0.41824442 -0.28678678 0.6903450
#> 
#> Treatment Ranking:
#>  treatment mean_effect  std_error mean_rank median_rank      sucra     sucr_a
#>          D   0.6075706 0.11120514   1.02900           1 99.0333333 99.0333333
#>          C   0.3993497 0.10789614   2.00275           2 66.5750000 66.5750000
#>          B   0.2056048 0.09666314   2.98375           3 33.8750000 33.8750000
#>          A   0.0000000 0.00000000   3.98450           4  0.5166667  0.5166667
#>  p_best
#>   0.971
#>   0.029
#>   0.000
#>   0.000
#> 
#> Contribution Decomposition (top rows):
#> Fixed-Effect Design Diagnostics:
#> $rank
#> [1] NA
#> 
#> $ncol
#> [1] 3
#> 
#> $condition_number
#> [1] 4.27001
#> 
#> $info_condition_number
#> [1] NA
#> 
#> $singular
#> [1] TRUE
#> 
#> $near_singular
#> [1] FALSE
#> 
#> $recommendation
#> [1] "Fixed-effect information matrix is rank-deficient/ill-conditioned; consider simplifying contrasts, merging sparse levels, or adding regularization."
#> 
#> 
#> Treatment Order:
#>  rank treatment effect_vs_reference
#>     1         D              0.6076
#>     2         C              0.3993
#>     3         B              0.2056
#>     4         A              0.0000
#> 
#> Direct / Indirect / Total Effects:
#>  treatment_1 treatment_2 direct direct_se direct_n_studies direct_n_effects
#>            A           B 0.2100    0.1095                3                3
#>            A           C 0.3878    0.1491                2                2
#>            A           D 0.6100    0.2449                1                1
#>            B           C 0.1950    0.1414                2                2
#>            B           D 0.4082    0.1651                2                2
#>            C           D 0.2050    0.1581                2                2
#>  direct_observed direct_observed_se indirect indirect_se indirect_n_paths
#>           0.2100             0.1095  -0.0044      0.1461                2
#>           0.3878             0.1491   0.0116      0.1840                2
#>           0.6100             0.2449  -0.0024      0.2690                2
#>           0.1950             0.1414  -0.0013      0.1757                2
#>           0.4082             0.1651  -0.0062      0.1961                2
#>           0.2050             0.1581   0.0032      0.1927                2
#>  indirect_n_studies indirect_n_effects  total total_se total_n_studies
#>                   7                  7 0.2056   0.0967               9
#>                   8                  8 0.3993   0.1079               9
#>                   8                  9 0.6076   0.1112               9
#>                   8                  9 0.1937   0.1043              10
#>                   8                  8 0.4020   0.1058              10
#>                   7                  7 0.2082   0.1102               9
#>  total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#>               10         -0.0047          0.4247                  -0.0047
#>               10          0.0956          0.6800                   0.0956
#>               10          0.1299          1.0901                   0.1299
#>               11         -0.0822          0.4722                  -0.0822
#>               10          0.0845          0.7319                   0.0845
#>                9         -0.1049          0.5149                  -0.1049
#>  direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#>                    0.4247           -0.2907            0.2819         0.0161
#>                    0.6800           -0.3491            0.3722         0.1879
#>                    1.0901           -0.5297            0.5248         0.3896
#>                    0.4722           -0.3457            0.3432        -0.0108
#>                    0.7319           -0.3906            0.3782         0.1946
#>                    0.5149           -0.3745            0.3809        -0.0077
#>  total_ci_upper
#>          0.3951
#>          0.6108
#>          0.8255
#>          0.3983
#>          0.6094
#>          0.4241
#> 
#> Indirect SE note:
#> Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance. 
#> 
#> Heterogeneity Summary:
#> Overall Q:
#> $value
#>           [,1]
#> [1,] 0.1092282
#> 
#> $df
#> [1] 9
#> 
#> $p
#>      [,1]
#> [1,]    1
#> 
#> 
#> Q by random effect level:
#>          level           Q df   p_value n_groups
#>       study_id 0.000155816  1 0.9900406        1
#>   component_id 0.000000000  0        NA        0
#>  .nma_nested_1 0.000000000  0        NA        0
#>  .nma_nested_2 0.000000000  0        NA        0
#> 
#> Level-specific I2 / Tau2:
#>      component  tau2           Q df   p_value n_groups          I2
#>  .nma_nested_1 1e-06 0.000000000  0        NA        0 0.004014865
#>  .nma_nested_2 1e-06 0.000000000  0        NA        0 0.004014865
#>   component_id 1e-06 0.000000000  0        NA        0 0.004014865
#>       study_id 1e-06 0.000155816  1 0.9900406        1 0.004014865
#> 
#> Total I^2:
#> [1] 0.002294248
#> 
#> Within I^2:
#> [1] 0.004014865 0.004014865 0.004014865 0.004014865
#> 
#> Between-study variance (tau^2):
#>      component  tau2
#>       study_id 1e-06
#>   component_id 1e-06
#>  .nma_nested_1 1e-06
#>  .nma_nested_2 1e-06

Example: Outcomes Within Study, Comparisons Within Outcome

The example below uses two explicit nested levels for multilevel NMA:

  1. outcome within study
  2. comparison_within_outcome within outcome
nma_nested_dat <- nma_dat
nma_nested_dat$outcome <- rep(c("pain", "function"), length.out = nrow(nma_nested_dat))
nma_nested_dat$comparison_within_outcome <- ave(
  seq_len(nrow(nma_nested_dat)),
  nma_nested_dat$study,
  nma_nested_dat$outcome,
  FUN = seq_along
)

nma_ml_outcome_nested <- network_meta(
  data = nma_nested_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multilevel",
  tau_components = "comparison",
  nested_levels = c("outcome", "comparison_within_outcome"),
  estimation_method = "MLE"
)
#> Warning in return_estimates(q_f = q_f, q_r = q_r, estimated_pars =
#> optim_values[["par"]], : Hessian inversion fallback: used eigen-based
#> pseudo-inverse; hessian may be singular/indefinite

nma_ml_outcome_nested$fit$formula
#> effect ~ -1 + d_B + d_C + d_D + (1 | study_id/component_id/.nma_nested_1/.nma_nested_2)
#> <environment: 0x558c4d4e44d8>
nma_ml_outcome_nested$heterogeneity_summary$Q_by_level
#>           level           Q df   p_value n_groups
#> 1      study_id 0.000155816  1 0.9900406        1
#> 2  component_id 0.000000000  0        NA        0
#> 3 .nma_nested_1 0.000000000  0        NA        0
#> 4 .nma_nested_2 0.000000000  0        NA        0
nma_ml_outcome_nested$heterogeneity_summary$tau2
#>       component  tau2
#> 1      study_id 1e-06
#> 2  component_id 1e-06
#> 3 .nma_nested_1 1e-06
#> 4 .nma_nested_2 1e-06

Multilevel and robustID

In network_meta(), robustID is restricted to model_type = "multivariate". For multilevel models, clustering is handled through random effects (study_id, tau_components, nested_levels), so robustID now returns a clear error.

Forest Plots for Network Effects

network_forest_plot() provides a standard forest plot for one selected effect type ("direct", "indirect", or "total").

network_forest_plot(
  nma_ml_flexible,
  effect_type = "total",
  order_by = "effect",
  right_digits = 2,
  main = "Network Forest Plot: Total Effects"
)

network_forest_overlay_plot() draws direct, total, and indirect effects for each comparison using nearly overlapping lines for fast visual comparison.

network_forest_overlay_plot(
  nma_ml_flexible,
  order_by = "total",
  right_label = "all",
  right_digits = 2,
  main = "Overlay Forest Plot: Direct vs Indirect vs Total"
)

Contribution Heatmap (Base R)

network_contribution_heatmap() visualizes the percentage information contributed by each direct comparison estimate to each network comparison.

network_contribution_heatmap(
  nma_ml_flexible,
  main = "Contribution Matrix Heatmap",
  show_values = FALSE
)

Speed Controls

For larger networks, control can enable sparse matrix algebra, reuse cached intermediate matrices, and parallelize selected post-fit computations.

nma_ml_fast <- network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multilevel",
  tau_components = "comparison",
  estimation_method = "MLE",
  control = list(
    use_sparse = TRUE,
    reuse_inverses = TRUE,
    parallel = 2
  )
)

nma_ml_fast$control
#> $use_sparse
#> [1] TRUE
#> 
#> $reuse_inverses
#> [1] TRUE
#> 
#> $parallel
#> [1] 2
#> 
#> $singular_threshold
#> [1] 1e+08

All Plots for All Fitted Models

The chunk below draws the three plot types (forest, overlay, contribution heatmap) for each model fit in this vignette.

op <- par(mfrow = c(1, 3))
network_forest_plot(nma_ml_flexible, effect_type = "total", main = "ML Flexible: Total")

network_forest_overlay_plot(nma_ml_flexible, order_by = "total", right_label = "total",
                            main = "ML Flexible: Overlay")

network_contribution_heatmap(nma_ml_flexible, main = "ML Flexible: Contribution")

par(op)
op <- par(mfrow = c(1, 3))
network_forest_plot(nma_ml_nested, effect_type = "total", main = "ML Nested: Total")

network_forest_overlay_plot(nma_ml_nested, order_by = "total", right_label = "total",
                            main = "ML Nested: Overlay")

network_contribution_heatmap(nma_ml_nested, main = "ML Nested: Contribution")

par(op)
op <- par(mfrow = c(1, 3))
network_forest_plot(nma_ml_outcome_nested, effect_type = "total", main = "ML Outcome Nested: Total")

network_forest_overlay_plot(nma_ml_outcome_nested, order_by = "total", right_label = "total",
                            main = "ML Outcome Nested: Overlay")

network_contribution_heatmap(nma_ml_outcome_nested, main = "ML Outcome Nested: Contribution")

par(op)

Multivariate Network Meta-analysis

You can also fit in multivariate mode using model_type = "multivariate". Use within_varcov_type to choose the within-study covariance structure used by the multivariate engine (for example "multilevel"/"univariate" or metric-based options such as "log_or" or "smd_shared_control" when those required fields are available).

nma_mv <- suppressWarnings(network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multivariate",
  heterogeneity = "flexible",
  estimation_method = "MLE",
  within_varcov_type = "multilevel"
))

summary(nma_mv)
#> Network Meta-analysis (MARS)
#> Model Type: multivariate 
#> Heterogeneity: flexible 
#> Within-study covariance type: multilevel 
#> Stored within-study covariance blocks: 11 
#> Reference: A 
#> Treatments: A, B, C, D 
#> 
#> Evidence Summary:
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
#> 
#> 
#> Incoherence-Factor Assessment:
#> Global test:
#>  Q_incoherence df    p_value
#>       10.75994  6 0.09608507
#> 
#> Per-comparison incoherence factors:
#>  treatment_1 treatment_2 incoherence_factor     if_se         z    p_value
#>            A           B          0.2143952 0.1826008 1.1741196 0.24034713
#>            A           C          0.3762057 0.2368231 1.5885514 0.11216170
#>            A           D          0.6124294 0.3638208 1.6833273 0.09231176
#>            B           C          0.1962549 0.2255816 0.8699954 0.38430291
#>            B           D          0.4143979 0.2564000 1.6162167 0.10604746
#>            C           D          0.2017793 0.2492712 0.8094771 0.41824078
#>     ci_lower  ci_upper
#>  -0.14349582 0.5722862
#>  -0.08795907 0.8403704
#>  -0.10064619 1.3255051
#>  -0.24587682 0.6383867
#>  -0.08813678 0.9169326
#>  -0.28678326 0.6903419
#> 
#> Contribution Matrix (% information from direct comparisons):
#>        A vs B A vs C A vs D B vs C B vs D C vs D
#> A vs B  90.37   4.42   0.29   3.82   1.04   0.06
#> A vs C  41.34  36.50   0.66  16.71   0.59   4.21
#> A vs D  50.86  12.36   3.52   0.64  16.35  16.26
#> B vs C  29.11  13.62   0.03  46.64   4.49   6.11
#> B vs D  24.22   1.45   2.15  13.68  38.74  19.76
#> C vs D   1.08   8.82   1.80  15.68  16.64  55.98
#> 
#> Model Fixed Effects (SE fallback applied when needed):
#>                            term  estimate  std_error  z_value      p_value
#>  factor(data[[effectID]])A vs B 0.2100001 0.08649398 2.427915 1.518588e-02
#>  factor(data[[effectID]])A vs C 0.3900000 0.11168692 3.491904 4.795908e-04
#>  factor(data[[effectID]])A vs D 0.6100000 0.12247653 4.980546 6.340508e-07
#>  factor(data[[effectID]])B vs C 0.1944445 0.10540989 1.844651 6.508834e-02
#>  factor(data[[effectID]])B vs D 0.4077778 0.10540821 3.868559 1.094806e-04
#>  factor(data[[effectID]])C vs D 0.2000001 0.10934126 1.829137 6.737914e-02
#>  se_source
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#> 
#> Fit Statistics:
#>  model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p   logLik
#>        <NA>          <NA>            0      NA      <NA> NA    NA   NA 7.024345
#>      Dev     AIC      BIC      AICc
#>  9.95131 9.95131 15.77019 -130.0487
#> 
#> Node-Splitting Assessment:
#>  Q_node_split df    p_value
#>      10.75994  6 0.09608507
#> 
#>  treatment_1 treatment_2    direct     indirect direct_indirect_diff   diff_se
#>            A           B 0.2100000 -0.004395181            0.2143952 0.1826008
#>            A           C 0.3877778  0.011572112            0.3762057 0.2368231
#>            A           D 0.6100000 -0.002429438            0.6124294 0.3638208
#>            B           C 0.1950000 -0.001254930            0.1962549 0.2255816
#>            B           D 0.4081818 -0.006216076            0.4143979 0.2564000
#>            C           D 0.2050000  0.003220672            0.2017793 0.2492712
#>          z    p_value    ci_lower  ci_upper
#>  1.1741196 0.24034713 -0.14349582 0.5722862
#>  1.5885514 0.11216170 -0.08795907 0.8403704
#>  1.6833273 0.09231176 -0.10064619 1.3255051
#>  0.8699954 0.38430291 -0.24587682 0.6383867
#>  1.6162167 0.10604746 -0.08813678 0.9169326
#>  0.8094771 0.41824078 -0.28678326 0.6903419
#> 
#> Treatment Ranking:
#>  treatment mean_effect  std_error mean_rank median_rank    sucra   sucr_a
#>          D   0.6075706 0.11120055   1.03425           1 98.85833 98.85833
#>          C   0.3993499 0.10789224   2.00025           2 66.65833 66.65833
#>          B   0.2056048 0.09665948   2.98125           3 33.95833 33.95833
#>          A   0.0000000 0.00000000   3.98425           4  0.52500  0.52500
#>   p_best
#>  0.96575
#>  0.03425
#>  0.00000
#>  0.00000
#> 
#> Contribution Decomposition (top rows):
#> Fixed-Effect Design Diagnostics:
#> $rank
#> [1] NA
#> 
#> $ncol
#> [1] 3
#> 
#> $condition_number
#> [1] 4.269947
#> 
#> $info_condition_number
#> [1] NA
#> 
#> $singular
#> [1] TRUE
#> 
#> $near_singular
#> [1] FALSE
#> 
#> $recommendation
#> [1] "Fixed-effect information matrix is rank-deficient/ill-conditioned; consider simplifying contrasts, merging sparse levels, or adding regularization."
#> 
#> 
#> Treatment Order:
#>  rank treatment effect_vs_reference
#>     1         D              0.6076
#>     2         C              0.3993
#>     3         B              0.2056
#>     4         A              0.0000
#> 
#> Direct / Indirect / Total Effects:
#>  treatment_1 treatment_2 direct direct_se direct_n_studies direct_n_effects
#>            A           B 0.2100    0.1095                3                3
#>            A           C 0.3878    0.1491                2                2
#>            A           D 0.6100    0.2449                1                1
#>            B           C 0.1950    0.1414                2                2
#>            B           D 0.4082    0.1651                2                2
#>            C           D 0.2050    0.1581                2                2
#>  direct_observed direct_observed_se indirect indirect_se indirect_n_paths
#>           0.2100             0.1095  -0.0044      0.1461                2
#>           0.3878             0.1491   0.0116      0.1840                2
#>           0.6100             0.2449  -0.0024      0.2690                2
#>           0.1950             0.1414  -0.0013      0.1757                2
#>           0.4082             0.1651  -0.0062      0.1961                2
#>           0.2050             0.1581   0.0032      0.1927                2
#>  indirect_n_studies indirect_n_effects  total total_se total_n_studies
#>                   7                  7 0.2056   0.0967               9
#>                   8                  8 0.3993   0.1079               9
#>                   8                  9 0.6076   0.1112               9
#>                   8                  9 0.1937   0.1043              10
#>                   8                  8 0.4020   0.1058              10
#>                   7                  7 0.2082   0.1102               9
#>  total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#>               10         -0.0047          0.4247                  -0.0047
#>               10          0.0956          0.6800                   0.0956
#>               10          0.1299          1.0901                   0.1299
#>               11         -0.0822          0.4722                  -0.0822
#>               10          0.0845          0.7319                   0.0845
#>                9         -0.1049          0.5149                  -0.1049
#>  direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#>                    0.4247           -0.2907            0.2819         0.0162
#>                    0.6800           -0.3491            0.3722         0.1879
#>                    1.0901           -0.5297            0.5248         0.3896
#>                    0.4722           -0.3457            0.3432        -0.0108
#>                    0.7319           -0.3906            0.3782         0.1946
#>                    0.5149           -0.3745            0.3809        -0.0077
#>  total_ci_upper
#>          0.3951
#>          0.6108
#>          0.8255
#>          0.3982
#>          0.6093
#>          0.4241
#> 
#> Indirect SE note:
#> Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance. 
#> 
#> Heterogeneity Summary:
#> Overall Q:
#> $value
#>          [,1]
#> [1,] 9.140389
#> 
#> $df
#> [1] 6
#> 
#> $p
#>           [,1]
#> [1,] 0.1658353
#> 
#> 
#> Within-level Q:
#> $`A vs B`
#>  QE_value     QE_df      QE_p 
#> 0.0400000 2.0000000 0.9801987 
#> 
#> $`A vs C`
#>  QE_value     QE_df      QE_p 
#> 0.0160000 1.0000000 0.8993432 
#> 
#> $`A vs D`
#> [1] "only one effect size in this category"
#> 
#> $`B vs C`
#>    QE_value       QE_df        QE_p 
#> 0.001111111 1.000000000 0.973408772 
#> 
#> $`B vs D`
#>   QE_value      QE_df       QE_p 
#> 0.01777778 1.00000000 0.89392977 
#> 
#> $`C vs D`
#>  QE_value     QE_df      QE_p 
#> 0.0250000 1.0000000 0.8743671 
#> 
#> 
#> Total I^2:
#> [1] 93.43997
#> 
#> Within I^2:
#> [1]  0.002136528  0.002136528 95.528876009 95.528876009 95.528876009
#> [6] 95.528876009
#> 
#> Between-study variance (tau^2):
#>  component  tau2
#>     A vs B 1e-06
#>     A vs C 1e-06
#>     A vs D 1e+00
#>     B vs C 1e+00
#>     B vs D 1e+00
#>     C vs D 1e+00

Multivariate with Cluster-Robust Standard Errors

For multivariate NMA where studies contribute multiple outcomes or multiple contrasts, cluster-robust SEs can be requested by setting robustID:

nma_mv_cluster <- suppressWarnings(network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multivariate",
  heterogeneity = "flexible",
  estimation_method = "MLE",
  within_varcov_type = "multilevel",
  robustID = "study"
))

nma_mv_cluster$fit_coefficients
#>                             term  estimate  std_error   z_value      p_value
#> 1 factor(data[[effectID]])A vs B 0.2100001 0.01471607 14.270117 3.360139e-46
#> 2 factor(data[[effectID]])A vs C 0.3900000 0.00642259 60.723171 0.000000e+00
#> 3 factor(data[[effectID]])A vs D 0.6100000 0.12247653  4.980546 6.340508e-07
#> 4 factor(data[[effectID]])B vs C 0.1944445 0.10540989  1.844651 6.508834e-02
#> 5 factor(data[[effectID]])B vs D 0.4077778 0.10540821  3.868559 1.094806e-04
#> 6 factor(data[[effectID]])C vs D 0.2000001 0.10934126  1.829137 6.737914e-02
#>        se_source
#> 1 cluster_robust
#> 2 cluster_robust
#> 3        hessian
#> 4        hessian
#> 5        hessian
#> 6        hessian
nma_mv_cluster$robust_cluster_id
#> [1] "study"

Multivariate with Moderators

nma_mv_mod <- suppressWarnings(network_meta(
  data = nma_dat,
  study_id = "study",
  treatment_1 = "trt1",
  treatment_2 = "trt2",
  effect = "yi",
  variance = "vi",
  reference = "A",
  model_type = "multivariate",
  heterogeneity = "flexible",
  moderators = c("severity", "followup_months"),
  estimation_method = "MLE"
))

summary(nma_mv_mod)
#> Network Meta-analysis (MARS)
#> Model Type: multivariate 
#> Heterogeneity: flexible 
#> Moderators: severity, followup_months 
#> Within-study covariance type: multilevel 
#> Stored within-study covariance blocks: 11 
#> Reference: A 
#> Treatments: A, B, C, D 
#> 
#> Evidence Summary:
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
#> 
#> 
#> Incoherence-Factor Assessment:
#> Global test:
#>  Q_incoherence df   p_value
#>       9.935036  6 0.1274146
#> 
#> Per-comparison incoherence factors:
#>  treatment_1 treatment_2 incoherence_factor     if_se          z    p_value
#>            A           B          0.2682826 0.4318164  0.6212886 0.53440973
#>            A           C         -0.3675853 0.3107103 -1.1830483 0.23679000
#>            A           D         -0.5633495 0.3546375 -1.5885219 0.11216838
#>            B           C          0.1833119 0.4221076  0.4342776 0.66408688
#>            B           D         -0.3921117 0.2059983 -1.9034708 0.05697914
#>            C           D         -0.1668590 0.1238805 -1.3469346 0.17800131
#>    ci_lower   ci_upper
#>  -0.5780619 1.11462711
#>  -0.9765662 0.24139567
#>  -1.2584263 0.13172731
#>  -0.6440038 1.01062752
#>  -0.7958610 0.01163749
#>  -0.4096603 0.07594241
#> 
#> Contribution Matrix (% information from direct comparisons):
#>        A vs B A vs C A vs D B vs C B vs D C vs D
#> A vs B      0   0.16   2.14      0  97.69   0.01
#> A vs C      0  99.87   0.11      0   0.00   0.02
#> A vs D      0   6.76  92.80      0   0.00   0.43
#> B vs C      0   4.89   1.81      0  93.29   0.02
#> B vs D      0   0.00   0.00      0 100.00   0.00
#> C vs D      0  72.80  26.93      0   0.00   0.27
#> 
#> Model Fixed Effects (SE fallback applied when needed):
#>                            term    estimate std_error    z_value    p_value
#>  factor(data[[effectID]])A vs B  0.21372546 0.1568131  1.3629310 0.17290426
#>  factor(data[[effectID]])A vs C  0.36372546 0.2586715  1.4061290 0.15968583
#>  factor(data[[effectID]])A vs D  0.58372546 0.2633918  2.2161870 0.02667870
#>  factor(data[[effectID]])B vs C  0.20725491 0.1546595  1.3400723 0.18022184
#>  factor(data[[effectID]])B vs D  0.42973857 0.2207945  1.9463285 0.05161529
#>  factor(data[[effectID]])C vs D  0.20549028 0.1192613  1.7230258 0.08488385
#>                        severity  0.37254908 2.0109120  0.1852637 0.85302218
#>                 followup_months -0.02666667 0.1331013 -0.2003487 0.84120789
#>  se_source
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#>    hessian
#> 
#> Fit Statistics:
#>  model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p   logLik
#>        <NA>          <NA>            0      NA      <NA> NA    NA   NA 7.234778
#>       Dev      AIC      BIC      AICc
#>  9.530444 13.53044 20.31914 -126.4696
#> 
#> Node-Splitting Assessment:
#>  Q_node_split df   p_value
#>      9.935036  6 0.1274146
#> 
#>  treatment_1 treatment_2      direct     indirect direct_indirect_diff
#>            A           B 0.233333333 -0.034949264            0.2682826
#>            A           C 0.010410142  0.377995400           -0.3675853
#>            A           D 0.016375839  0.579725324           -0.5633495
#>            B           C 0.186666667  0.003354805            0.1833119
#>            B           D 0.002802677  0.394914417           -0.3921117
#>            C           D 0.020418327  0.187277295           -0.1668590
#>    diff_se          z    p_value   ci_lower   ci_upper
#>  0.4318164  0.6212886 0.53440973 -0.5780619 1.11462711
#>  0.3107103 -1.1830483 0.23679000 -0.9765662 0.24139567
#>  0.3546375 -1.5885219 0.11216838 -1.2584263 0.13172731
#>  0.4221076  0.4342776 0.66408688 -0.6440038 1.01062752
#>  0.2059983 -1.9034708 0.05697914 -0.7958610 0.01163749
#>  0.1238805 -1.3469346 0.17800131 -0.4096603 0.07594241
#> 
#> Treatment Ranking:
#>  treatment mean_effect std_error mean_rank median_rank    sucra   sucr_a
#>          D   0.5961012 0.3545156   1.11775           1 96.07500 96.07500
#>          C   0.3884055 0.3106587   2.18750           2 60.41667 60.41667
#>          B   0.1983841 0.1938465   2.99750           3 33.41667 33.41667
#>          A   0.0000000 0.0000000   3.69725           4 10.09167 10.09167
#>   p_best
#>  0.91375
#>  0.03550
#>  0.01100
#>  0.03975
#> 
#> Contribution Decomposition (top rows):
#> Fixed-Effect Design Diagnostics:
#> $rank
#> [1] NA
#> 
#> $ncol
#> [1] 3
#> 
#> $condition_number
#> [1] 43.11297
#> 
#> $info_condition_number
#> [1] NA
#> 
#> $singular
#> [1] TRUE
#> 
#> $near_singular
#> [1] FALSE
#> 
#> $recommendation
#> [1] "Fixed-effect information matrix is rank-deficient/ill-conditioned; consider simplifying contrasts, merging sparse levels, or adding regularization."
#> 
#> 
#> Treatment Order:
#>  rank treatment effect_vs_reference
#>     1         D              0.5961
#>     2         C              0.3884
#>     3         B              0.1984
#>     4         A              0.0000
#> 
#> Direct / Indirect / Total Effects:
#>  treatment_1 treatment_2 direct direct_se direct_n_studies direct_n_effects
#>            A           B 0.2333    0.2728                3                3
#>            A           C 0.0104    0.0040                2                2
#>            A           D 0.0164    0.0066                1                1
#>            B           C 0.1867    0.2749                2                2
#>            B           D 0.0028    0.0011                2                2
#>            C           D 0.0204    0.0157                2                2
#>  direct_observed direct_observed_se indirect indirect_se indirect_n_paths
#>           0.2100             0.1095  -0.0349      0.3347                2
#>           0.3878             0.1491   0.3780      0.3107                2
#>           0.6100             0.2449   0.5797      0.3546                2
#>           0.1950             0.1414   0.0034      0.3203                2
#>           0.4082             0.1651   0.3949      0.2060                2
#>           0.2050             0.1581   0.1873      0.1229                2
#>  indirect_n_studies indirect_n_effects  total total_se total_n_studies
#>                   7                  7 0.1984   0.1938               9
#>                   8                  8 0.3884   0.3107               9
#>                   8                  9 0.5961   0.3545               9
#>                   8                  9 0.1900   0.1645              10
#>                   8                  8 0.3977   0.2060              10
#>                   7                  7 0.2077   0.1219               9
#>  total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#>               10         -0.3014          0.7681                  -0.0047
#>               10          0.0026          0.0183                   0.0956
#>               10          0.0035          0.0293                   0.1299
#>               11         -0.3521          0.7254                  -0.0822
#>               10          0.0006          0.0050                   0.0845
#>                9         -0.0104          0.0513                  -0.1049
#>  direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#>                    0.4247           -0.6909            0.6210        -0.1815
#>                    0.6800           -0.2309            0.9869        -0.2205
#>                    1.0901           -0.1152            1.2747        -0.0987
#>                    0.4722           -0.6245            0.6312        -0.1324
#>                    0.7319           -0.0088            0.7987        -0.0060
#>                    0.5149           -0.0536            0.4281        -0.0311
#>  total_ci_upper
#>          0.5783
#>          0.9973
#>          1.2909
#>          0.5125
#>          0.8015
#>          0.4465
#> 
#> Indirect SE note:
#> Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance. 
#> 
#> Heterogeneity Summary:
#> Overall Q:
#> $value
#>          [,1]
#> [1,] 9.140389
#> 
#> $df
#> [1] 6
#> 
#> $p
#>           [,1]
#> [1,] 0.1658353
#> 
#> 
#> Within-level Q:
#> $`A vs B`
#>  QE_value     QE_df      QE_p 
#> 0.0400000 2.0000000 0.9801987 
#> 
#> $`A vs C`
#>  QE_value     QE_df      QE_p 
#> 0.0160000 1.0000000 0.8993432 
#> 
#> $`A vs D`
#> [1] "only one effect size in this category"
#> 
#> $`B vs C`
#>    QE_value       QE_df        QE_p 
#> 0.001111111 1.000000000 0.973408772 
#> 
#> $`B vs D`
#>   QE_value      QE_df       QE_p 
#> 0.01777778 1.00000000 0.89392977 
#> 
#> $`C vs D`
#>  QE_value     QE_df      QE_p 
#> 0.0250000 1.0000000 0.8743671 
#> 
#> 
#> Total I^2:
#> [1] 93.43997
#> 
#> Within I^2:
#> [1]  0.002136528  0.002136528 95.528876009 95.528876009 95.528876009
#> [6] 95.528876009
#> 
#> Between-study variance (tau^2):
#>  component  tau2
#>     A vs B 1e-06
#>     A vs C 1e-06
#>     A vs D 1e+00
#>     B vs C 1e+00
#>     B vs D 1e+00
#>     C vs D 1e+00
nma_mv_mod$moderators
#> [1] "severity"        "followup_months"

The output structure is the same, including effects, heterogeneity summaries, and treatment order:

nma_mv$effects
#>   treatment_1 treatment_2    direct direct_se direct_n_studies direct_n_effects
#> 1           A           B 0.2100000 0.1095445                3                3
#> 2           A           C 0.3877778 0.1490712                2                2
#> 3           A           D 0.6100000 0.2449490                1                1
#> 4           B           C 0.1950000 0.1414214                2                2
#> 5           B           D 0.4081818 0.1651446                2                2
#> 6           C           D 0.2050000 0.1581139                2                2
#>   direct_observed direct_observed_se     indirect indirect_se indirect_n_paths
#> 1       0.2100000          0.1095445 -0.004395181   0.1460926                2
#> 2       0.3877778          0.1490712  0.011572112   0.1840189                2
#> 3       0.6100000          0.2449490 -0.002429438   0.2690085                2
#> 4       0.1950000          0.1414214 -0.001254930   0.1757471                2
#> 5       0.4081818          0.1651446 -0.006216076   0.1961331                2
#> 6       0.2050000          0.1581139  0.003220672   0.1927074                2
#>   indirect_n_studies indirect_n_effects     total   total_se total_n_studies
#> 1                  7                  7 0.2056048 0.09665948               9
#> 2                  8                  8 0.3993499 0.10789224               9
#> 3                  8                  9 0.6075706 0.11120055               9
#> 4                  8                  9 0.1937451 0.10434100              10
#> 5                  8                  8 0.4019657 0.10580870              10
#> 6                  7                  7 0.2082207 0.11016412               9
#>   total_n_effects direct_ci_lower direct_ci_upper direct_observed_ci_lower
#> 1              10    -0.004703297       0.4247033             -0.004703297
#> 2              10     0.095603598       0.6799520              0.095603598
#> 3              10     0.129908832       1.0900912              0.129908832
#> 4              11    -0.082180765       0.4721808             -0.082180765
#> 5              10     0.084504419       0.7318592              0.084504419
#> 6               9    -0.104897516       0.5148975             -0.104897516
#>   direct_observed_ci_upper indirect_ci_lower indirect_ci_upper total_ci_lower
#> 1                0.4247033        -0.2907315         0.2819411    0.016155725
#> 2                0.6799520        -0.3490983         0.3722425    0.187884992
#> 3                1.0900912        -0.5296764         0.5248175    0.389621491
#> 4                0.4721808        -0.3457129         0.3432031   -0.010759522
#> 5                0.7318592        -0.3906300         0.3781978    0.194584506
#> 6                0.5148975        -0.3744789         0.3809202   -0.007697043
#>   total_ci_upper
#> 1      0.3950539
#> 2      0.6108148
#> 3      0.8255196
#> 4      0.3982497
#> 5      0.6093470
#> 6      0.4241384
nma_mv$evidence_summary
#> $n_comparisons_total
#> [1] 6
#> 
#> $n_comparisons_with_direct
#> [1] 6
#> 
#> $n_comparisons_with_indirect
#> [1] 6
#> 
#> $n_comparisons_indirect_only
#> [1] 0
#> 
#> $n_direct_effects
#> [1] 12
#> 
#> $n_indirect_effects
#> [1] 48
nma_mv$indirect_se_note
#> [1] "Indirect SEs are approximate; for mixed direct+indirect comparisons, var(indirect) is computed as var(total) + var(direct) assuming zero covariance."
nma_mv$heterogeneity_summary
#> $Q_total
#> $Q_total$value
#>          [,1]
#> [1,] 9.140389
#> 
#> $Q_total$df
#> [1] 6
#> 
#> $Q_total$p
#>           [,1]
#> [1,] 0.1658353
#> 
#> 
#> $Q_within
#> $Q_within$`A vs B`
#>  QE_value     QE_df      QE_p 
#> 0.0400000 2.0000000 0.9801987 
#> 
#> $Q_within$`A vs C`
#>  QE_value     QE_df      QE_p 
#> 0.0160000 1.0000000 0.8993432 
#> 
#> $Q_within$`A vs D`
#> [1] "only one effect size in this category"
#> 
#> $Q_within$`B vs C`
#>    QE_value       QE_df        QE_p 
#> 0.001111111 1.000000000 0.973408772 
#> 
#> $Q_within$`B vs D`
#>   QE_value      QE_df       QE_p 
#> 0.01777778 1.00000000 0.89392977 
#> 
#> $Q_within$`C vs D`
#>  QE_value     QE_df      QE_p 
#> 0.0250000 1.0000000 0.8743671 
#> 
#> 
#> $Q_by_level
#> NULL
#> 
#> $I2_total
#> [1] 93.43997
#> 
#> $I2_within
#> [1]  0.002136528  0.002136528 95.528876009 95.528876009 95.528876009
#> [6] 95.528876009
#> 
#> $level_heterogeneity
#> NULL
#> 
#> $tau2
#>   component  tau2
#> 1    A vs B 1e-06
#> 2    A vs C 1e-06
#> 3    A vs D 1e+00
#> 4    B vs C 1e+00
#> 5    B vs D 1e+00
#> 6    C vs D 1e+00
nma_mv$heterogeneity_summary$tau2
#>   component  tau2
#> 1    A vs B 1e-06
#> 2    A vs C 1e-06
#> 3    A vs D 1e+00
#> 4    B vs C 1e+00
#> 5    B vs D 1e+00
#> 6    C vs D 1e+00
nma_mv$incoherence_assessment$global
#>   Q_incoherence df    p_value
#> 1      10.75994  6 0.09608507
nma_mv$incoherence_assessment$per_comparison
#>   treatment_1 treatment_2 incoherence_factor     if_se         z    p_value
#> 1           A           B          0.2143952 0.1826008 1.1741196 0.24034713
#> 2           A           C          0.3762057 0.2368231 1.5885514 0.11216170
#> 3           A           D          0.6124294 0.3638208 1.6833273 0.09231176
#> 4           B           C          0.1962549 0.2255816 0.8699954 0.38430291
#> 5           B           D          0.4143979 0.2564000 1.6162167 0.10604746
#> 6           C           D          0.2017793 0.2492712 0.8094771 0.41824078
#>      ci_lower  ci_upper
#> 1 -0.14349582 0.5722862
#> 2 -0.08795907 0.8403704
#> 3 -0.10064619 1.3255051
#> 4 -0.24587682 0.6383867
#> 5 -0.08813678 0.9169326
#> 6 -0.28678326 0.6903419
nma_mv$contribution_matrix
#>           A vs B    A vs C     A vs D     B vs C     B vs D      C vs D
#> A vs B 90.368175  4.423892 0.28859562  3.8207366  1.0435139  0.05508629
#> A vs C 41.342442 36.496433 0.65531482 16.7057362  0.5851147  4.21495961
#> A vs D 50.864110 12.358909 3.52304713  0.6445192 16.3481046 16.26130979
#> B vs C 29.107446 13.618556 0.02785936 46.6434337  4.4913978  6.11130750
#> B vs D 24.217443  1.453047 2.15266159 13.6821576 38.7374037 19.75728756
#> C vs D  1.076873  8.817042 1.80366089 15.6818831 16.6424910 55.97804929
nma_mv$treatment_order
#>   rank treatment effect_vs_reference
#> 1    1         D           0.6075706
#> 2    2         C           0.3993499
#> 3    3         B           0.2056048
#> 4    4         A           0.0000000
nma_mv$node_splitting$global
#>   Q_node_split df    p_value
#> 1     10.75994  6 0.09608507
nma_mv$ranking$rankings
#>   treatment mean_effect  std_error mean_rank median_rank    sucra   sucr_a
#> D         D   0.6075706 0.11120055   1.03425           1 98.85833 98.85833
#> C         C   0.3993499 0.10789224   2.00025           2 66.65833 66.65833
#> B         B   0.2056048 0.09665948   2.98125           3 33.95833 33.95833
#> A         A   0.0000000 0.00000000   3.98425           4  0.52500  0.52500
#>    p_best
#> D 0.96575
#> C 0.03425
#> B 0.00000
#> A 0.00000
nma_mv$fit_stats
#>   model_type heterogeneity n_treatments n_edges estimator QE QE_df QE_p
#> 1       <NA>          <NA>            0      NA      <NA> NA    NA   NA
#>     logLik     Dev     AIC      BIC      AICc
#> 1 7.024345 9.95131 9.95131 15.77019 -130.0487
nma_mv$level_heterogeneity_summary
#> NULL
nma_mv$heterogeneity_summary$level_heterogeneity
#> NULL
op <- par(mfrow = c(1, 3))
network_forest_plot(nma_mv, effect_type = "total", main = "Multivariate: Total")

network_forest_overlay_plot(nma_mv, order_by = "total", right_label = "total",
                            main = "Multivariate: Overlay")

network_contribution_heatmap(nma_mv, main = "Multivariate: Contribution")

par(op)

Compare multilevel and multivariate model fit side-by-side on the same dataset

mars:::compare_nma_models(
  multilevel = nma_ml_flexible,
  multivariate = nma_mv,
  nested = nma_ml_nested
)
#>                model_type heterogeneity n_treatments n_edges estimator
#> multilevel     multilevel      flexible            4       6       MLE
#> multivariate multivariate      flexible            4       6       MLE
#> nested         multilevel      flexible            4       6       MLE
#>                     QE QE_df      QE_p   logLik       Dev      AIC       BIC
#> multilevel   0.1092282     9 1.0000000 3.204918  9.590164 3.590164  6.014697
#> multivariate 9.1403889     6 0.1658353 7.024345  9.951310 9.951310 15.770189
#> nested       0.1092282     9 1.0000000 3.204852 13.590296 7.590296 10.984642
#>                   AICc AIC_rank BIC_rank AICc_rank
#> multilevel    223.5902        1        1         3
#> multivariate -130.0487        3        3         2
#> nested       -304.4097        2        2         1