Author: Hugo Pedder
Date: 2025-02-06

# MBNMAdose outputs: Relative effects, forest plots and rankings

#### Hugo Pedder

#### 2025-02-06

For looking at outputs from MBNMAdose we will demonstrate using results from an Emax MBNMA on the triptans dataset:

    tripnet <- mbnma.network(triptans)
    #> Values for `agent` with dose = 0 have been recoded to `Placebo`
    #> agent is being recoded to enforce sequential numbering
    trip.emax <- mbnma.run(tripnet, fun = demax(emax = "rel", ed50 = "rel"))
    #> `likelihood` not given by user - set to `binomial` based on data provided
    #> `link` not given by user - set to `logit` based on assigned value for `likelihood`

## Estimating relative effects

It may be of interest to calculate relative effects between different doses of agents to obtain outputs that are more similar to those from standard NMA. A benefit of dose-response MBNMA is that relative effects between doses that have not been explored in trials can still be compared.

Relative effects can take the form of odds ratios, mean differences or rate ratios, depending on the likelihood and link function used in a model. Estimating relative effects can be particularly helpful for dose-response functions where parameter interpretation can be challenging (e.g. splines, fractional polynomials).

The `get.relative()` function allows for calculation of relative effects between any doses of agents as specified by the user. This includes doses not available in the original dataset, as these can be estimated via the dose-response relationship. Optional arguments allow for relative effects to be estimated at specific effect modifier values (if meta-regression incorporated into MBNMA model), calculation of 95% prediction intervals rather than 95% credible intervals (the default), and for the conversion of results from the log to the natural scale. The resulting relative effects can also be ranked (see Ranking for more details).

    # Specify treatments (agents and doses) for which to estimate relative effects
    treats <- list(Placebo = 0, eletriptan = 1, sumatriptan = 2, almotriptan = 1)

    # Print relative effects on the natural scale
    rels <- get.relative(trip.emax, treatments = treats, eform = TRUE)
    print(rels)
    #> ============================================================
    #> Relative treatment comparisons (95% credible intervals)
    #> ============================================================
    #>
    #>     Placebo_0      5.3 (4.6, 6.2)     4 (3.6, 4.4)      2.3 (2, 2.6)
    #>  5.3 (4.6, 6.2)     eletriptan_1    0.74 (0.64, 0.86) 0.43 (0.36, 0.51)
    #>   4 (3.6, 4.4)    0.74 (0.64, 0.86)   sumatriptan_2   0.58 (0.5, 0.66)
    #>   2.3 (2, 2.6)    0.43 (0.36, 0.51) 0.58 (0.5, 0.66)    almotriptan_1

    # Rank relative effects
    rank(rels)
    #>
    #> ================================
    #> Ranking of dose-response MBNMA
    #> ================================
    #>
    #> Includes ranking of relative effects
    #>
    #> 4 relefs ranked with negative responses being `worse`
    #>
    #> RelativeEffects ranking (from best to worst)
    #>
    #> |Treatment     | Mean| Median| 2.5%| 97.5%|
    #> |:-------------|----:|------:|----:|-----:|
    #> |eletriptan_1  |    1|      1|    1|     1|
    #> |sumatriptan_2 |    2|      2|    2|     2|
    #> |almotriptan_1 |    3|      3|    3|     3|
    #> |Placebo_0     |    4|      4|    4|     4|

`get.relative()` can also be used to compare results between two different models by specifying which model’s relative effects should be presented in the lower left diagonal (`lower.diag`) of the table, and which should be presented in the upper right diagnoal (`upper.diag`).

This can be used to compare relative effects estimated by MBNMA models fitted with different dose-response relationships, or to compare MBNMA estimates with NMA estimates.

    nma <- nma.run(tripnet)  # NMA (consistency) model
    ume <- nma.run(tripnet, UME = TRUE)  # UME (inconsistency) model

    # MBNMA consistency and NMA consistency odds ratios compared
    consistency <- get.relative(lower.diag = trip.emax, upper.diag = nma, treatments = treats,
        eform = TRUE)
    print(consistency)
    #> ============================================================
    #> Relative treatment comparisons (95% credible intervals)
    #> ============================================================
    #>
    #>     Placebo_0       5.8 (5, 6.7)     4.2 (3.8, 4.7)    2.8 (2.4, 3.2)
    #>  5.3 (4.6, 6.2)     eletriptan_1    0.73 (0.63, 0.84) 0.48 (0.4, 0.58)
    #>   4 (3.6, 4.4)    0.74 (0.64, 0.86)   sumatriptan_2   0.66 (0.56, 0.78)
    #>   2.3 (2, 2.6)    0.43 (0.36, 0.51) 0.58 (0.5, 0.66)    almotriptan_1

It can also be used to compare NMA or MBNMA consistency models with Unrelated Mean Effects (UME) inconsistency models. A UME model only parameterises direct comparisons within the network and so can be used to test the consistency assumption ([Checking for consistency][3-consistencychecking.html]). Note that if a UME model is fitted, comparisons for which there is no direct evidence will not have relative effects estimated for them.

    # MBNMA consistency and NMA inconsistency log-odds ratios compared
    inconsistency <- get.relative(lower.diag = trip.emax, upper.diag = ume, treatments = treats,
        eform = FALSE)
    print(inconsistency)
    #> ============================================================
    #> Relative treatment comparisons (95% credible intervals)
    #> ============================================================
    #>
    #>      Placebo_0                NA                   NA                   NA
    #>    1.7 (1.5, 1.8)        eletriptan_1              NA                0 (0, 0)
    #>    1.4 (1.3, 1.5)    -0.3 (-0.44, -0.15)     sumatriptan_2              NA
    #>  0.83 (0.71, 0.94)    -0.85 (-1, -0.68)   -0.55 (-0.69, -0.41)    almotriptan_1

## Forest plots

Forest plots can be easily generated from MBNMA models using the `plot()` method on an `"mbnma"` object. By default this will plot a separate panel for each dose-response parameter in the model. Forest plots can only be generated for parameters which are modelled using relative effects and that vary by agent/class.

    plot(trip.emax)

## Ranking

Rankings can be calculated for different dose-response parameters from MBNMA models by using `rank()` on an `"mbnma"` object. Any parameter monitored in an MBNMA model that varies by agent/class can be ranked. A vector of these is assigned to `params`. `lower_better` indicates whether negative responses should be ranked as “better” (`TRUE`) or “worse” (`FALSE`).

    ranks <- rank(trip.emax, lower_better = FALSE)
    print(ranks)
    #>
    #> ================================
    #> Ranking of dose-response MBNMA
    #> ================================
    #>
    #> Includes ranking of relative treatment effects from dose-response MBNMA:
    #> emax ed50
    #>
    #>
    #> 7 agents ranked with positive responses being `better`
    #>
    #> emax ranking (from best to worst)
    #>
    #> |Treatment    | Mean| Median| 2.5%| 97.5%|
    #> |:------------|----:|------:|----:|-----:|
    #> |sumatriptan  | 1.27|      1|    1|     2|
    #> |zolmitriptan | 2.06|      2|    1|     3|
    #> |eletriptan   | 2.66|      3|    2|     3|
    #> |naratriptan  | 4.74|      5|    4|     7|
    #> |frovatriptan | 5.32|      5|    4|     7|
    #> |almotriptan  | 5.83|      6|    4|     7|
    #> |rizatriptan  | 6.11|      6|    4|     7|
    #>
    #>
    #> ed50 ranking (from best to worst)
    #>
    #> |Treatment    | Mean| Median| 2.5%| 97.5%|
    #> |:------------|----:|------:|----:|-----:|
    #> |eletriptan   | 1.25|      1|    1|     3|
    #> |sumatriptan  | 2.25|      2|    1|     3|
    #> |zolmitriptan | 2.50|      3|    1|     3|
    #> |rizatriptan  | 5.08|      5|    4|     7|
    #> |frovatriptan | 5.21|      5|    4|     7|
    #> |naratriptan  | 5.81|      6|    4|     7|
    #> |almotriptan  | 5.90|      6|    4|     7|
    summary(ranks)
    #> $emax
    #>     rank.param     mean        sd 2.5% 25% 50% 75% 97.5%
    #> 1   eletriptan 2.664667 0.5042846    2   2   3   3     3
    #> 2  sumatriptan 1.275000 0.4866079    1   1   1   2     2
    #> 3 frovatriptan 5.322333 1.1064248    4   4   5   6     7
    #> 4  almotriptan 5.828667 0.9575753    4   5   6   7     7
    #> 5 zolmitriptan 2.060333 0.7336252    1   2   2   3     3
    #> 6  naratriptan 4.741000 0.8764560    4   4   5   5     7
    #> 7  rizatriptan 6.108000 1.0033302    4   5   6   7     7
    #>
    #> $ed50
    #>     rank.param     mean        sd 2.5% 25% 50% 75% 97.5%
    #> 1   eletriptan 1.251333 0.4935377    1   1   1   1     3
    #> 2  sumatriptan 2.249333 0.6239359    1   2   2   3     3
    #> 3 frovatriptan 5.208000 1.1244958    4   4   5   6     7
    #> 4  almotriptan 5.901667 1.0284372    4   5   6   7     7
    #> 5 zolmitriptan 2.499333 0.7039162    1   2   3   3     3
    #> 6  naratriptan 5.812667 1.1114486    4   5   6   7     7
    #> 7  rizatriptan 5.077667 0.9598307    4   4   5   6     7

The output is an object of `class("mbnma.rank")`, containing a list for each ranked parameter in `params`, which consists of a summary table of rankings and raw information on agent/class (depending on argument given to `level`) ranking and probabilities. The summary median ranks with 95% credible intervals can be simply displayed using `summary()`.

Histograms for ranking results can also be plotted using the `plot()` method, which takes the raw MCMC ranking results stored in `mbnma.rank` and plots the number of MCMC iterations the parameter value for each treatment was ranked a particular position.

    # Ranking histograms for Emax
    plot(ranks, params = "emax")

    # Ranking histograms for ED50
    plot(ranks, params = "ed50")

Alternatively, cumulative ranking plots for all parameters can be plotted simultaneously so as to be able to compare the effectiveness of different agents on different parameters. The surface under cumulative ranking curve (SUCRA) for each parameter can also be estimated by setting `sucra=TRUE`.

    # Cumulative ranking plot for both dose-response parameters
    cumrank(ranks, sucra = TRUE)

    #> # A tibble: 14 × 3
    #>    agent        parameter  sucra
    #>    <fct>        <chr>      <dbl>
    #>  1 eletriptan   ed50      0.419
    #>  2 eletriptan   emax      0.345
    #>  3 sumatriptan  ed50      0.371
    #>  4 sumatriptan  emax      0.418
    #>  5 frovatriptan ed50      0.164
    #>  6 frovatriptan emax      0.156
    #>  7 almotriptan  ed50      0.114
    #>  8 almotriptan  emax      0.119
    #>  9 zolmitriptan ed50      0.353
    #> 10 zolmitriptan emax      0.380
    #> 11 naratriptan  ed50      0.121
    #> 12 naratriptan  emax      0.197
    #> 13 rizatriptan  ed50      0.173
    #> 14 rizatriptan  emax      0.0994

## References