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.96103461  0.4787077738  1.22821664  1.65238304
#> Ce_200  -0.961034609          NA -0.4856469514  0.26871815  0.69224079
#> Et_10   -0.478707774  0.48564695            NA  0.75366625  1.17201008
#> Et_30   -1.228216643 -0.26871815 -0.7536662512          NA  0.42188178
#> Et_60   -1.652383043 -0.69224079 -1.1720100841 -0.42188178          NA
#> Et_90   -1.728865224 -0.76896718 -1.2489730887 -0.49469318 -0.07415946
#> Lu_100  -0.918930675  0.04056182 -0.4391071842  0.31069220  0.73092671
#> Na_1000 -1.198118726 -0.23720961 -0.7173601881  0.03231904  0.45329833
#> Na_1500 -1.124594931 -0.16238080 -0.6429130349  0.10348977  0.52644337
#> Na_250  -0.006753349  0.95248989  0.4711502139  1.22220993  1.64120472
#> Na_750  -0.874043084  0.08597490 -0.3926811264  0.35459363  0.77521654
#> Ro_12   -0.944095355  0.01297419 -0.4668093742  0.28745657  0.70531622
#> Ro_125  -2.367597158 -1.40872129 -1.8922484293 -1.13483422 -0.71587707
#> Ro_25   -1.293198476 -0.33328318 -0.8115165344 -0.06321517  0.35762851
#> Tr_100  -0.474093934  0.48368456  0.0060812761  0.75649186  1.17393326
#> Tr_200  -0.480151024  0.48143975  0.0002301439  0.74842374  1.17021253
#> Tr_300  -0.838551367  0.12426541 -0.3555555801  0.39357270  0.81278235
#> Tr_400  -0.927857432  0.03127664 -0.4400428325  0.30167647  0.72426780
#> Va_10   -0.754420146  0.20747361 -0.2703618677  0.47818478  0.89821404
#> Va_20   -0.987110066 -0.02825168 -0.5065330838  0.24228177  0.66120937
#> Va_5    -0.843815624  0.11883824 -0.3634983589  0.38560680  0.80657641
#> Ce_100  -0.553353943  0.40498396 -0.0709626789  0.67967283  1.09789023
#> Ce_400  -0.904767724  0.05633500 -0.4240689290  0.33070009  0.74960799
#> Du_90   -0.553045575  0.41106117 -0.0659046497  0.68151734  1.10284851
#> Et_5    -1.028660625 -0.06951404 -0.5471234259  0.20362431  0.61995399
#> Lu_200  -0.545252568  0.41638080 -0.0677801612  0.68495098  1.10688678
#> Lu_400  -0.709315875  0.25130851 -0.2272174917  0.52303970  0.94588709
#> Lu_NA   -0.795898852  0.16745827 -0.3137188459  0.43599656  0.85594264
#> Ox_44   -1.074993057 -0.11685397 -0.6011510347  0.15899566  0.57412251
#>               Et_90       Lu_100     Na_1000     Na_1500       Na_250
#> Pl_0     1.72886522  0.918930675  1.19811873  1.12459493  0.006753349
#> Ce_200   0.76896718 -0.040561824  0.23720961  0.16238080 -0.952489889
#> Et_10    1.24897309  0.439107184  0.71736019  0.64291303 -0.471150214
#> Et_30    0.49469318 -0.310692199 -0.03231904 -0.10348977 -1.222209929
#> Et_60    0.07415946 -0.730926708 -0.45329833 -0.52644337 -1.641204717
#> Et_90            NA -0.806554348 -0.53181663 -0.60014842 -1.720970455
#> Lu_100   0.80655435           NA  0.27853508  0.20651608 -0.907105247
#> Na_1000  0.53181663 -0.278535084          NA -0.07250543 -1.187087241
#> Na_1500  0.60014842 -0.206516082  0.07250543          NA -1.114307386
#> Na_250   1.72097046  0.907105247  1.18708724  1.11430739           NA
#> Na_750   0.85605247  0.043800231  0.32286953  0.24828638 -0.868958054
#> Ro_12    0.77971146 -0.027172394  0.25056763  0.18088993 -0.932888322
#> Ro_125  -0.63826295 -1.451102785 -1.16956614 -1.24179308 -2.354017830
#> Ro_25    0.43173333 -0.375133123 -0.09335932 -0.16951779 -1.289460824
#> Tr_100   1.24964010  0.443914688  0.72014657  0.64809892 -0.468760144
#> Tr_200   1.24949595  0.442030150  0.71618094  0.64131857 -0.469052844
#> Tr_300   0.88878239  0.081171243  0.35990152  0.28644322 -0.830893938
#> Tr_400   0.79935306 -0.007738603  0.27030416  0.19513042 -0.920492036
#> Va_10    0.96661066  0.167161057  0.44681746  0.36877638 -0.745121819
#> Va_20    0.74153152 -0.069235031  0.21074905  0.13855282 -0.974153199
#> Va_5     0.88352930  0.077685490  0.35565086  0.28156233 -0.836516782
#> Ce_100   1.17173826  0.365904761  0.64660176  0.57134972 -0.539854990
#> Ce_400   0.82342205  0.018484809  0.29804223  0.22522565 -0.889730845
#> Du_90    1.17903938  0.369381957  0.64599140  0.57502588 -0.536488689
#> Et_5     0.69939513 -0.108347312  0.17028675  0.10028841 -1.016984585
#> Lu_200   1.18438179  0.376398195  0.65376853  0.57934066 -0.540932722
#> Lu_400   1.01792908  0.212983691  0.49185280  0.41999651 -0.702021088
#> Lu_NA    0.93435929  0.125341666  0.40375721  0.33152076 -0.782420737
#> Ox_44    0.65393213 -0.156135543  0.12459415  0.04962048 -1.064744103
#>              Na_750       Ro_12    Ro_125       Ro_25       Tr_100
#> Pl_0     0.87404308  0.94409535 2.3675972  1.29319848  0.474093934
#> Ce_200  -0.08597490 -0.01297419 1.4087213  0.33328318 -0.483684564
#> Et_10    0.39268113  0.46680937 1.8922484  0.81151653 -0.006081276
#> Et_30   -0.35459363 -0.28745657 1.1348342  0.06321517 -0.756491860
#> Et_60   -0.77521654 -0.70531622 0.7158771 -0.35762851 -1.173933264
#> Et_90   -0.85605247 -0.77971146 0.6382630 -0.43173333 -1.249640096
#> Lu_100  -0.04380023  0.02717239 1.4511028  0.37513312 -0.443914688
#> Na_1000 -0.32286953 -0.25056763 1.1695661  0.09335932 -0.720146571
#> Na_1500 -0.24828638 -0.18088993 1.2417931  0.16951779 -0.648098920
#> Na_250   0.86895805  0.93288832 2.3540178  1.28946082  0.468760144
#> Na_750           NA  0.06949145 1.4908282  0.41594776 -0.396444390
#> Ro_12   -0.06949145          NA 1.4185970  0.34539773 -0.468789555
#> Ro_125  -1.49082818 -1.41859704        NA -1.07122352 -1.893964521
#> Ro_25   -0.41594776 -0.34539773 1.0712235          NA -0.817636802
#> Tr_100   0.39644439  0.46878956 1.8939645  0.81763680           NA
#> Tr_200   0.39270734  0.46618627 1.8852669  0.81386057 -0.004636722
#> Tr_300   0.03462791  0.10932570 1.5252405  0.45348354 -0.365181616
#> Tr_400  -0.05478530  0.02000783 1.4400226  0.36292074 -0.453963647
#> Va_10    0.12231068  0.19295203 1.6193414  0.54231400 -0.274733281
#> Va_20   -0.11205902 -0.04378595 1.3827800  0.30678364 -0.507579392
#> Va_5     0.03109391  0.10190337 1.5263759  0.45163653 -0.362402210
#> Ce_100   0.32475499  0.39490586 1.8148446  0.74314603 -0.074585797
#> Ce_400  -0.02517588  0.04606319 1.4651194  0.39314442 -0.425829099
#> Du_90    0.32403674  0.39614262 1.8207118  0.74945606 -0.074434940
#> Et_5    -0.15579367 -0.07904749 1.3426891  0.27101803 -0.548136557
#> Lu_200   0.33064688  0.39953096 1.8235486  0.74760510 -0.069257180
#> Lu_400   0.16739912  0.23932303 1.6578847  0.58887788 -0.230742322
#> Lu_NA    0.08299674  0.15319154 1.5769416  0.49714476 -0.317298050
#> Ox_44   -0.20174002 -0.13157444 1.2916954  0.21994702 -0.602325086
#>                Tr_200       Tr_300       Tr_400       Va_10       Va_20
#> Pl_0     0.4801510237  0.838551367  0.927857432  0.75442015  0.98711007
#> Ce_200  -0.4814397549 -0.124265407 -0.031276637 -0.20747361  0.02825168
#> Et_10   -0.0002301439  0.355555580  0.440042833  0.27036187  0.50653308
#> Et_30   -0.7484237439 -0.393572697 -0.301676472 -0.47818478 -0.24228177
#> Et_60   -1.1702125338 -0.812782350 -0.724267797 -0.89821404 -0.66120937
#> Et_90   -1.2494959501 -0.888782390 -0.799353064 -0.96661066 -0.74153152
#> Lu_100  -0.4420301499 -0.081171243  0.007738603 -0.16716106  0.06923503
#> Na_1000 -0.7161809434 -0.359901515 -0.270304162 -0.44681746 -0.21074905
#> Na_1500 -0.6413185691 -0.286443216 -0.195130416 -0.36877638 -0.13855282
#> Na_250   0.4690528438  0.830893938  0.920492036  0.74512182  0.97415320
#> Na_750  -0.3927073369 -0.034627912  0.054785303 -0.12231068  0.11205902
#> Ro_12   -0.4661862749 -0.109325697 -0.020007829 -0.19295203  0.04378595
#> Ro_125  -1.8852669335 -1.525240509 -1.440022571 -1.61934140 -1.38277998
#> Ro_25   -0.8138605698 -0.453483536 -0.362920740 -0.54231400 -0.30678364
#> Tr_100   0.0046367224  0.365181616  0.453963647  0.27473328  0.50757939
#> Tr_200             NA  0.357084806  0.444435476  0.27511578  0.50301032
#> Tr_300  -0.3570848062           NA  0.088205480 -0.08356090  0.15072347
#> Tr_400  -0.4444354757 -0.088205480           NA -0.17226463  0.05988759
#> Va_10   -0.2751157788  0.083560901  0.172264631          NA  0.23594913
#> Va_20   -0.5030103246 -0.150723471 -0.059887592 -0.23594913          NA
#> Va_5    -0.3612223577 -0.004645471  0.084402140 -0.08464596  0.14534351
#> Ce_100  -0.0705358524  0.285177982  0.376909990  0.20075845  0.43204536
#> Ce_400  -0.4223245710 -0.062355702  0.026386112 -0.14840452  0.08581500
#> Du_90   -0.0676254006  0.291480827  0.379084362  0.20371918  0.43508570
#> Et_5    -0.5430334473 -0.190763027 -0.096947060 -0.27080281 -0.04085513
#> Lu_200  -0.0623748718  0.294113729  0.383484965  0.20995134  0.44271526
#> Lu_400  -0.2261935627  0.129341133  0.217381923  0.04569202  0.28070707
#> Lu_NA   -0.3153875655  0.045525487  0.134389567 -0.03776895  0.19686019
#> Ox_44   -0.5938515461 -0.240485457 -0.147666893 -0.32435043 -0.08944222
#>                 Va_5       Ce_100      Ce_400        Du_90        Et_5
#> Pl_0     0.843815624  0.553353943  0.90476772  0.553045575  1.02866062
#> Ce_200  -0.118838236 -0.404983956 -0.05633500 -0.411061173  0.06951404
#> Et_10    0.363498359  0.070962679  0.42406893  0.065904650  0.54712343
#> Et_30   -0.385606802 -0.679672825 -0.33070009 -0.681517341 -0.20362431
#> Et_60   -0.806576407 -1.097890234 -0.74960799 -1.102848510 -0.61995399
#> Et_90   -0.883529295 -1.171738261 -0.82342205 -1.179039384 -0.69939513
#> Lu_100  -0.077685490 -0.365904761 -0.01848481 -0.369381957  0.10834731
#> Na_1000 -0.355650862 -0.646601757 -0.29804223 -0.645991397 -0.17028675
#> Na_1500 -0.281562333 -0.571349717 -0.22522565 -0.575025882 -0.10028841
#> Na_250   0.836516782  0.539854990  0.88973084  0.536488689  1.01698458
#> Na_750  -0.031093907 -0.324754995  0.02517588 -0.324036737  0.15579367
#> Ro_12   -0.101903372 -0.394905862 -0.04606319 -0.396142623  0.07904749
#> Ro_125  -1.526375921 -1.814844620 -1.46511935 -1.820711818 -1.34268908
#> Ro_25   -0.451636533 -0.743146028 -0.39314442 -0.749456055 -0.27101803
#> Tr_100   0.362402210  0.074585797  0.42582910  0.074434940  0.54813656
#> Tr_200   0.361222358  0.070535852  0.42232457  0.067625401  0.54303345
#> Tr_300   0.004645471 -0.285177982  0.06235570 -0.291480827  0.19076303
#> Tr_400  -0.084402140 -0.376909990 -0.02638611 -0.379084362  0.09694706
#> Va_10    0.084645962 -0.200758452  0.14840452 -0.203719179  0.27080281
#> Va_20   -0.145343515 -0.432045355 -0.08581500 -0.435085703  0.04085513
#> Va_5              NA -0.289066653  0.05650033 -0.288311152  0.18260908
#> Ce_100   0.289066653           NA  0.35145365  0.001325617  0.47150412
#> Ce_400  -0.056500330 -0.351453647          NA -0.350958841  0.12536905
#> Du_90    0.288311152 -0.001325617  0.35095884           NA  0.48034190
#> Et_5    -0.182609076 -0.471504124 -0.12536905 -0.480341899          NA
#> Lu_200   0.299094225  0.009064791  0.35915856  0.009330239  0.48337385
#> Lu_400   0.135210912 -0.153030670  0.19460255 -0.155008322  0.31810196
#> Lu_NA    0.050133610 -0.241180210  0.10697699 -0.247954849  0.23756277
#> Ox_44   -0.229724544 -0.523443890 -0.17017884 -0.531055906 -0.04995463
#>               Lu_200      Lu_400       Lu_NA       Ox_44
#> Pl_0     0.545252568  0.70931588  0.79589885  1.07499306
#> Ce_200  -0.416380803 -0.25130851 -0.16745827  0.11685397
#> Et_10    0.067780161  0.22721749  0.31371885  0.60115103
#> Et_30   -0.684950977 -0.52303970 -0.43599656 -0.15899566
#> Et_60   -1.106886776 -0.94588709 -0.85594264 -0.57412251
#> Et_90   -1.184381785 -1.01792908 -0.93435929 -0.65393213
#> Lu_100  -0.376398195 -0.21298369 -0.12534167  0.15613554
#> Na_1000 -0.653768531 -0.49185280 -0.40375721 -0.12459415
#> Na_1500 -0.579340658 -0.41999651 -0.33152076 -0.04962048
#> Na_250   0.540932722  0.70202109  0.78242074  1.06474410
#> Na_750  -0.330646884 -0.16739912 -0.08299674  0.20174002
#> Ro_12   -0.399530957 -0.23932303 -0.15319154  0.13157444
#> Ro_125  -1.823548636 -1.65788468 -1.57694163 -1.29169541
#> Ro_25   -0.747605100 -0.58887788 -0.49714476 -0.21994702
#> Tr_100   0.069257180  0.23074232  0.31729805  0.60232509
#> Tr_200   0.062374872  0.22619356  0.31538757  0.59385155
#> Tr_300  -0.294113729 -0.12934113 -0.04552549  0.24048546
#> Tr_400  -0.383484965 -0.21738192 -0.13438957  0.14766689
#> Va_10   -0.209951340 -0.04569202  0.03776895  0.32435043
#> Va_20   -0.442715262 -0.28070707 -0.19686019  0.08944222
#> Va_5    -0.299094225 -0.13521091 -0.05013361  0.22972454
#> Ce_100  -0.009064791  0.15303067  0.24118021  0.52344389
#> Ce_400  -0.359158561 -0.19460255 -0.10697699  0.17017884
#> Du_90   -0.009330239  0.15500832  0.24795485  0.53105591
#> Et_5    -0.483373848 -0.31810196 -0.23756277  0.04995463
#> Lu_200            NA  0.16294203  0.24955334  0.53358212
#> Lu_400  -0.162942028          NA  0.08338881  0.36837114
#> Lu_NA   -0.249553339 -0.08338881          NA  0.28422431
#> Ox_44   -0.533582116 -0.36837114 -0.28422431          NA


# }