Skip to contents

Uses mbnma time-course parameter estimates to calculate treatment differences between treatments or classes at a particular time-point. Can be used to compare treatments evaluated in studies at different follow-up times, or even to compare treatments in different MBNMA models via a common comparator.

Usage

get.relative(
  mbnma,
  mbnma.add = NULL,
  time = max(mbnma$model.arg$jagsdata$time, na.rm = TRUE),
  treats = unique(c(mbnma$network$treatments, mbnma.add$network$treatments)),
  classes = NULL,
  lim = "cred"
)

Arguments

mbnma

An S3 object of class "mbnma" generated by running a time-course MBNMA model

mbnma.add

An S3 object of class("mbnma") generated by running a time-course MBNMA model. This should only be specified if results from two different MBNMA models are to be combined to perform a 2-stage MBNMA (see Details).

time

A numeric value for the time at which to estimate relative effects/mean differences.

treats

A character vector of treatment names for which to calculate relative effects/mean differences. Must be a subset of mbnma$network$treatments.

classes

A character vector of class names for which to calculate relative effects/mean differences. Must be a subset of mbnma$network$classes. Only works for class effect models.

lim

Specifies calculation of either 95% credible intervals (lim="cred") or 95% prediction intervals (lim="pred").

Value

An object of class "relative.array" list containing:

  • The time-point for which results are estimated

  • Matrices of posterior means, medians, SDs and upper and lower 95% credible intervals for the differences between each treatment

  • An array containing MCMC results for the differences between all treatments specified in treats or all classes specified in classes.

Results are reported in tables as the row-defined treatment minus the column-defined treatment.

Details

get.relative() can also be used to perform a 2-stage MBNMA that allows synthesis of results from two different MBNMA models via a single common comparator. In an MBNMA model, all treatments must share the same time-course function. However, a 2-stage approach can enable fitting of different time-course functions to different sets ("subnetworks") of treatments. For example, some treatments may have rich time-course information, allowing for a more complex time-course function to be used, whereas others may be sparse, requiring a simpler time-course function.

Relative comparisons between treatments in the two datasets at specific follow-up times can then be estimated from MBNMA predicted effects versus a common comparator using the Bucher method and assuming consistency. See the MBNMAtime vignette for further details.

Examples

# \donttest{
# Create an mb.network object from a dataset
alognet <- mb.network(alog_pcfb)
#> Reference treatment is `placebo`
#> Studies reporting change from baseline automatically identified from the data

# Run a quadratic time-course MBNMA using the alogliptin dataset
mbnma <- mb.run(alognet,
  fun=tpoly(degree=2,
  pool.1="rel", method.1="random",
  pool.2="rel", method.2="common"
  )
)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 233
#>    Unobserved stochastic nodes: 71
#>    Total graph size: 4375
#> 
#> Initializing model
#> 

# Calculate differences between all treatments at 20 weeks follow-up
allres <- get.relative(mbnma, time=20)

# Calculate difference between a subset of treatments at 10 weeks follow-up
subres <- get.relative(mbnma, time=10,
  treats=c("alog_50", "alog_25", "placebo"))



###########################
##### 2-stage MBNMA #####
###########################

# Using the osteoarthritis dataset
# With placebo (Pl_0) as common comparator between subnetworks

#### Sparse model ####

# Treatments on which time-course data is limited
sparse.trt <- c("Ce_100", "Ce_400", "Du_90", "Lu_200", "Lu_400",
  "Lu_NA", "Et_5", "Ox_44")

# Create a subnetwork of studies comparing these treatments
sparse.df <- osteopain %>% dplyr::group_by(studyID) %>%
  dplyr::filter(any(treatment %in% sparse.trt)) %>%
  dplyr::ungroup() %>%
  subset(treatment %in% c("Pl_0", sparse.trt))

sparse.net <- mb.network(sparse.df)
#> Reference treatment is `Pl_0`
#> Studies reporting change from baseline automatically identified from the data

# Run a ITP MBNMA with a known rate
sparse.mbnma <- mb.run(sparse.net, fun=titp(method.rate=0.8, pool.rate="abs"))
#> 'rate' parameters must take positive values.
#>  Default half-normal prior restricts posterior to positive values.
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 76
#>    Unobserved stochastic nodes: 28
#>    Total graph size: 1447
#> 
#> Initializing model
#> 


#### Complex model ####

# Treatments on which time-course data is rich
rich.trt <- levels(osteopain$treatment)[!levels(osteopain$treatment) %in%
  c("Pl_0", "Ce_100", "Ce_400", "Du_90", "Lu_200",
    "Lu_400", "Lu_NA", "Et_5", "Ox_44")]

# Create a subnetwork of studies comparing these treatments
rich.df <- osteopain %>% dplyr::group_by(studyID) %>%
  dplyr::filter(any(treatment %in% rich.trt)) %>%
  dplyr::ungroup() %>%
  subset(treatment %in% c("Pl_0", rich.trt))

rich.net <- mb.network(rich.df)
#> Reference treatment is `Pl_0`
#> Studies reporting change from baseline automatically identified from the data

# Run a Emax MBNMA
rich.mbnma <- mb.run(rich.net, temax(p.expon = FALSE))
#> 'et50' parameters must take positive values.
#>  Default half-normal prior restricts posterior to positive values.
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 363
#>    Unobserved stochastic nodes: 121
#>    Total graph size: 7221
#> 
#> Initializing model
#> 


#### Calculate relative effects between models ####

# At 10 weeks follow-up
rels.sparse <- get.relative(sparse.mbnma, time=10)
rels.rich <- get.relative(rich.mbnma, time=10)

rels.all <- get.relative(mbnma=rich.mbnma,
  mbnma.add=sparse.mbnma, time=10)

print(rels.all$median)
#>                 Pl_0      Ce_200        Et_10       Et_30       Et_60
#> Pl_0              NA  0.95918259  0.466710625  1.23004538  1.65265296
#> Ce_200  -0.959182588          NA -0.492290385  0.27033676  0.69016630
#> Et_10   -0.466710625  0.49229039           NA  0.76254630  1.18559779
#> Et_30   -1.230045384 -0.27033676 -0.762546305          NA  0.41857010
#> Et_60   -1.652652964 -0.69016630 -1.185597786 -0.41857010          NA
#> Et_90   -1.724778908 -0.76666064 -1.258540359 -0.49484922 -0.07491757
#> Lu_100  -0.917346562  0.04073924 -0.448103374  0.31201492  0.73210337
#> Na_1000 -1.199755828 -0.23931438 -0.731650817  0.03257920  0.45052519
#> Na_1500 -1.126212017 -0.16637474 -0.659069174  0.10521752  0.52352507
#> Na_250  -0.006084764  0.95374996  0.460073524  1.22444282  1.64101198
#> Na_750  -0.875521113  0.08431444 -0.406901301  0.35765486  0.77586125
#> Ro_12   -0.938776176  0.02269970 -0.475169810  0.29231761  0.71456974
#> Ro_125  -2.364851557 -1.40400332 -1.890588093 -1.13510330 -0.71596613
#> Ro_25   -1.296433394 -0.33703449 -0.833707434 -0.06675126  0.35591598
#> Tr_100  -0.472421416  0.48582826 -0.001087801  0.75818983  1.17833880
#> Tr_200  -0.471703914  0.48880747 -0.002072625  0.75916762  1.18074633
#> Tr_300  -0.837522718  0.12310011 -0.369756383  0.39439747  0.81035354
#> Tr_400  -0.923267606  0.03710481 -0.451966903  0.30901465  0.72690279
#> Va_10   -0.753983493  0.20488985 -0.283991330  0.47858966  0.89379531
#> Va_20   -0.988967045 -0.03008524 -0.518029397  0.24527126  0.66939516
#> Va_5    -0.844425011  0.11436518 -0.376595991  0.38630625  0.80289521
#> Ce_100  -0.547751355  0.41090180 -0.076143653  0.68209644  1.10145691
#> Ce_400  -0.899766418  0.05994513 -0.427390675  0.33231984  0.75167142
#> Du_90   -0.549435949  0.40953724 -0.081710525  0.67645690  1.09995549
#> Et_5    -1.026999277 -0.06689911 -0.551081393  0.20267677  0.62653498
#> Lu_200  -0.547560145  0.41217711 -0.080600364  0.68356688  1.10419343
#> Lu_400  -0.708694395  0.24969355 -0.242353177  0.52364668  0.94288181
#> Lu_NA   -0.801457663  0.15903235 -0.334010297  0.42936465  0.85381557
#> Ox_44   -1.082640560 -0.12237772 -0.606590654  0.14936844  0.56804469
#>               Et_90        Lu_100     Na_1000     Na_1500       Na_250
#> Pl_0     1.72477891  0.9173465616  1.19975583  1.12621202  0.006084764
#> Ce_200   0.76666064 -0.0407392415  0.23931438  0.16637474 -0.953749959
#> Et_10    1.25854036  0.4481033745  0.73165082  0.65906917 -0.460073524
#> Et_30    0.49484922 -0.3120149223 -0.03257920 -0.10521752 -1.224442816
#> Et_60    0.07491757 -0.7321033660 -0.45052519 -0.52352507 -1.641011982
#> Et_90            NA -0.8079787672 -0.52937619 -0.59810064 -1.718647541
#> Lu_100   0.80797877            NA  0.27913840  0.20774690 -0.915803327
#> Na_1000  0.52937619 -0.2791383962          NA -0.07286883 -1.194354447
#> Na_1500  0.59810064 -0.2077468984  0.07286883          NA -1.118961330
#> Na_250   1.71864754  0.9158033274  1.19435445  1.11896133           NA
#> Na_750   0.84865853  0.0414197140  0.32127259  0.25283592 -0.868298460
#> Ro_12    0.78964456 -0.0211886275  0.25933344  0.18357524 -0.930920573
#> Ro_125  -0.63935255 -1.4433515355 -1.16605360 -1.23714499 -2.352876100
#> Ro_25    0.42586105 -0.3779539905 -0.09960430 -0.16935223 -1.294259264
#> Tr_100   1.25715078  0.4460387383  0.72655630  0.65215403 -0.463495739
#> Tr_200   1.25568699  0.4486841168  0.72480331  0.65390537 -0.464260032
#> Tr_300   0.88834851  0.0820983630  0.36139664  0.28788758 -0.831338053
#> Tr_400   0.80314043 -0.0009584191  0.27601129  0.20495021 -0.911274129
#> Va_10    0.97152121  0.1618617633  0.44432735  0.37495261 -0.742567367
#> Va_20    0.74256281 -0.0683937205  0.21320338  0.13795989 -0.983387916
#> Va_5     0.87948141  0.0754513808  0.35139869  0.28316574 -0.838953857
#> Ce_100   1.17662519  0.3709897698  0.64805937  0.57740303 -0.537633374
#> Ce_400   0.82975966  0.0203914095  0.30031176  0.22690686 -0.888550728
#> Du_90    1.17217642  0.3654105952  0.64967678  0.57786564 -0.534703345
#> Et_5     0.70026782 -0.1033162809  0.17146702  0.09883982 -1.010439712
#> Lu_200   1.17874990  0.3731072058  0.65113059  0.57949510 -0.541987221
#> Lu_400   1.01886543  0.2084367953  0.48864051  0.41733953 -0.705462982
#> Lu_NA    0.92540240  0.1166314398  0.39817751  0.32813176 -0.792917675
#> Ox_44    0.64150049 -0.1655966166  0.11715124  0.04663816 -1.065231063
#>              Na_750       Ro_12    Ro_125       Ro_25       Tr_100       Tr_200
#> Pl_0     0.87552111  0.93877618 2.3648516  1.29643339  0.472421416  0.471703914
#> Ce_200  -0.08431444 -0.02269970 1.4040033  0.33703449 -0.485828262 -0.488807467
#> Et_10    0.40690130  0.47516981 1.8905881  0.83370743  0.001087801  0.002072625
#> Et_30   -0.35765486 -0.29231761 1.1351033  0.06675126 -0.758189832 -0.759167623
#> Et_60   -0.77586125 -0.71456974 0.7159661 -0.35591598 -1.178338804 -1.180746328
#> Et_90   -0.84865853 -0.78964456 0.6393526 -0.42586105 -1.257150783 -1.255686986
#> Lu_100  -0.04141971  0.02118863 1.4433515  0.37795399 -0.446038738 -0.448684117
#> Na_1000 -0.32127259 -0.25933344 1.1660536  0.09960430 -0.726556299 -0.724803305
#> Na_1500 -0.25283592 -0.18357524 1.2371450  0.16935223 -0.652154025 -0.653905368
#> Na_250   0.86829846  0.93092057 2.3528761  1.29425926  0.463495739  0.464260032
#> Na_750           NA  0.06406561 1.4878904  0.42102581 -0.402474843 -0.406996985
#> Ro_12   -0.06406561          NA 1.4300249  0.35596039 -0.466149278 -0.467975778
#> Ro_125  -1.48789044 -1.43002485        NA -1.06205221 -1.893982919 -1.891163155
#> Ro_25   -0.42102581 -0.35596039 1.0620522          NA -0.823251637 -0.823842468
#> Tr_100   0.40247484  0.46614928 1.8939829  0.82325164           NA -0.005332686
#> Tr_200   0.40699699  0.46797578 1.8911632  0.82384247  0.005332686           NA
#> Tr_300   0.03764390  0.10238766 1.5227183  0.46053966 -0.368288737 -0.366907135
#> Tr_400  -0.04575480  0.01720518 1.4436848  0.37387539 -0.447394328 -0.451095929
#> Va_10    0.12438386  0.18518952 1.6075386  0.54109070 -0.283229534 -0.283859706
#> Va_20   -0.11179022 -0.04715719 1.3729501  0.31068400 -0.515237419 -0.514308556
#> Va_5     0.03330463  0.09347622 1.5106536  0.45412636 -0.373994404 -0.376100135
#> Ce_100   0.32772786  0.39110061 1.8144919  0.75117763 -0.071344042 -0.075947204
#> Ce_400  -0.02190133  0.04144782 1.4702637  0.40455290 -0.427715125 -0.426868136
#> Du_90    0.32210666  0.39701743 1.8210691  0.75045849 -0.077097460 -0.081302335
#> Et_5    -0.15118486 -0.08404743 1.3391341  0.26956430 -0.550843860 -0.552194329
#> Lu_200   0.32825112  0.39351859 1.8201347  0.75166632 -0.073687628 -0.072865433
#> Lu_400   0.16869069  0.23060822 1.6561104  0.58991347 -0.234595324 -0.234262575
#> Lu_NA    0.07726402  0.13851913 1.5644797  0.49689879 -0.323556384 -0.327405330
#> Ox_44   -0.20761644 -0.14445091 1.2882159  0.21725705 -0.611300891 -0.607976639
#>               Tr_300        Tr_400       Va_10       Va_20         Va_5
#> Pl_0     0.837522718  0.9232676062  0.75398349  0.98896704  0.844425011
#> Ce_200  -0.123100113 -0.0371048100 -0.20488985  0.03008524 -0.114365185
#> Et_10    0.369756383  0.4519669031  0.28399133  0.51802940  0.376595991
#> Et_30   -0.394397475 -0.3090146506 -0.47858966 -0.24527126 -0.386306253
#> Et_60   -0.810353538 -0.7269027886 -0.89379531 -0.66939516 -0.802895209
#> Et_90   -0.888348507 -0.8031404270 -0.97152121 -0.74256281 -0.879481407
#> Lu_100  -0.082098363  0.0009584191 -0.16186176  0.06839372 -0.075451381
#> Na_1000 -0.361396638 -0.2760112919 -0.44432735 -0.21320338 -0.351398689
#> Na_1500 -0.287887577 -0.2049502082 -0.37495261 -0.13795989 -0.283165741
#> Na_250   0.831338053  0.9112741293  0.74256737  0.98338792  0.838953857
#> Na_750  -0.037643895  0.0457548044 -0.12438386  0.11179022 -0.033304635
#> Ro_12   -0.102387662 -0.0172051817 -0.18518952  0.04715719 -0.093476224
#> Ro_125  -1.522718284 -1.4436847571 -1.60753862 -1.37295008 -1.510653588
#> Ro_25   -0.460539657 -0.3738753932 -0.54109070 -0.31068400 -0.454126358
#> Tr_100   0.368288737  0.4473943281  0.28322953  0.51523742  0.373994404
#> Tr_200   0.366907135  0.4510959291  0.28385971  0.51430856  0.376100135
#> Tr_300            NA  0.0837007672 -0.08294226  0.14787798  0.005479795
#> Tr_400  -0.083700767            NA -0.16501137  0.06670763 -0.076970766
#> Va_10    0.082942262  0.1650113684          NA  0.23139029  0.090739014
#> Va_20   -0.147877984 -0.0667076279 -0.23139029          NA -0.138342551
#> Va_5    -0.005479795  0.0769707661 -0.09073901  0.13834255           NA
#> Ce_100   0.293612081  0.3731382955  0.20610739  0.44041574  0.301127162
#> Ce_400  -0.062317439  0.0216588189 -0.14323847  0.08658911 -0.053280475
#> Du_90    0.286350146  0.3707824518  0.20309642  0.43808050  0.296968112
#> Et_5    -0.186433452 -0.1015442798 -0.27529265 -0.03680180 -0.183406848
#> Lu_200   0.290702253  0.3733680376  0.20720542  0.43842248  0.301136656
#> Lu_400   0.125834457  0.2112705754  0.04443065  0.27539071  0.136989300
#> Lu_NA    0.038261893  0.1224799245 -0.04568097  0.18809309  0.049075744
#> Ox_44   -0.250170165 -0.1565037749 -0.32855729 -0.09269652 -0.232109478
#>                Ce_100      Ce_400        Du_90        Et_5        Lu_200
#> Pl_0     0.5477513548  0.89976642  0.549435949  1.02699928  0.5475601452
#> Ce_200  -0.4109017986 -0.05994513 -0.409537239  0.06689911 -0.4121771110
#> Et_10    0.0761436532  0.42739068  0.081710525  0.55108139  0.0806003639
#> Et_30   -0.6820964445 -0.33231984 -0.676456904 -0.20267677 -0.6835668780
#> Et_60   -1.1014569115 -0.75167142 -1.099955486 -0.62653498 -1.1041934275
#> Et_90   -1.1766251907 -0.82975966 -1.172176417 -0.70026782 -1.1787498981
#> Lu_100  -0.3709897698 -0.02039141 -0.365410595  0.10331628 -0.3731072058
#> Na_1000 -0.6480593650 -0.30031176 -0.649676777 -0.17146702 -0.6511305949
#> Na_1500 -0.5774030287 -0.22690686 -0.577865640 -0.09883982 -0.5794950971
#> Na_250   0.5376333745  0.88855073  0.534703345  1.01043971  0.5419872209
#> Na_750  -0.3277278602  0.02190133 -0.322106663  0.15118486 -0.3282511213
#> Ro_12   -0.3911006114 -0.04144782 -0.397017431  0.08404743 -0.3935185931
#> Ro_125  -1.8144919422 -1.47026371 -1.821069110 -1.33913409 -1.8201346505
#> Ro_25   -0.7511776272 -0.40455290 -0.750458489 -0.26956430 -0.7516663177
#> Tr_100   0.0713440418  0.42771512  0.077097460  0.55084386  0.0736876279
#> Tr_200   0.0759472041  0.42686814  0.081302335  0.55219433  0.0728654326
#> Tr_300  -0.2936120813  0.06231744 -0.286350146  0.18643345 -0.2907022530
#> Tr_400  -0.3731382955 -0.02165882 -0.370782452  0.10154428 -0.3733680376
#> Va_10   -0.2061073894  0.14323847 -0.203096417  0.27529265 -0.2072054230
#> Va_20   -0.4404157368 -0.08658911 -0.438080498  0.03680180 -0.4384224784
#> Va_5    -0.3011271624  0.05328048 -0.296968112  0.18340685 -0.3011366556
#> Ce_100             NA  0.35164477  0.005598568  0.47594275 -0.0008218787
#> Ce_400  -0.3516447651          NA -0.347855139  0.13077271 -0.3522256849
#> Du_90   -0.0055985679  0.34785514           NA  0.46967323 -0.0057834359
#> Et_5    -0.4759427495 -0.13077271 -0.469673226          NA -0.4792097042
#> Lu_200   0.0008218787  0.35222568  0.005783436  0.47920970            NA
#> Lu_400  -0.1594990377  0.18823095 -0.163047887  0.31517923 -0.1615613209
#> Lu_NA   -0.2494765666  0.09781576 -0.248924680  0.23171642 -0.2535212341
#> Ox_44   -0.5319581480 -0.18759694 -0.531892882 -0.05533429 -0.5364076602
#>              Lu_400       Lu_NA       Ox_44
#> Pl_0     0.70869439  0.80145766  1.08264056
#> Ce_200  -0.24969355 -0.15903235  0.12237772
#> Et_10    0.24235318  0.33401030  0.60659065
#> Et_30   -0.52364668 -0.42936465 -0.14936844
#> Et_60   -0.94288181 -0.85381557 -0.56804469
#> Et_90   -1.01886543 -0.92540240 -0.64150049
#> Lu_100  -0.20843680 -0.11663144  0.16559662
#> Na_1000 -0.48864051 -0.39817751 -0.11715124
#> Na_1500 -0.41733953 -0.32813176 -0.04663816
#> Na_250   0.70546298  0.79291768  1.06523106
#> Na_750  -0.16869069 -0.07726402  0.20761644
#> Ro_12   -0.23060822 -0.13851913  0.14445091
#> Ro_125  -1.65611035 -1.56447973 -1.28821587
#> Ro_25   -0.58991347 -0.49689879 -0.21725705
#> Tr_100   0.23459532  0.32355638  0.61130089
#> Tr_200   0.23426258  0.32740533  0.60797664
#> Tr_300  -0.12583446 -0.03826189  0.25017016
#> Tr_400  -0.21127058 -0.12247992  0.15650377
#> Va_10   -0.04443065  0.04568097  0.32855729
#> Va_20   -0.27539071 -0.18809309  0.09269652
#> Va_5    -0.13698930 -0.04907574  0.23210948
#> Ce_100   0.15949904  0.24947657  0.53195815
#> Ce_400  -0.18823095 -0.09781576  0.18759694
#> Du_90    0.16304789  0.24892468  0.53189288
#> Et_5    -0.31517923 -0.23171642  0.05533429
#> Lu_200   0.16156132  0.25352123  0.53640766
#> Lu_400           NA  0.09203902  0.37596276
#> Lu_NA   -0.09203902          NA  0.28142295
#> Ox_44   -0.37596276 -0.28142295          NA


# }